Modulo:Sandbox/ValterVB: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
.
.
Riga 1:
local p = {}
 
function p.IMDbTest(frame)
local tipo sec= frame.args[tonumber('tipo125'])
localif idseconds <= frame.args['id']0 then
return "00:00"
local pagina = mw.title.getCurrentTitle() --nome della pagina
else
local result = '* (\'\'\'EN\'\'\') Scheda su \'\'[http://www.imdb.com/'
hours = string.format("%02.f", math.floor(seconds/3600));
if tipo == 'titolo' or tipo == 'film' then
mins = string.format("%02.f", math.floor(seconds/60 - (hours*60)));
tipo = 'title/tt'
secs = string.format("%02.f", math.floor(seconds - hours*3600 - mins *60));
wpIMDb = 'tt' .. id -- codice IMDb presente su Wikipedia
end
elseif tipo == 'compagnia' then
tipo = 'company/co'
wpIMDb = 'co' .. id -- codice IMDb presente su Wikipedia
elseif tipo == 'nome' then
tipo = 'name/nm'
wpIMDb = 'nm' .. id -- codice IMDb presente su Wikipedia
elseif tipo == 'personaggio' then
tipo = 'character/ch'
wpIMDb = 'ch' .. id
end
local wdIMDb = frame:preprocess("{{#property:P345}}") -- codice IMDb presente su Wikidata
result = result .. tipo .. id
result = result .. '/ '
result = result .. pagina.text
result = result .. ']\'\' dell\'\[\[Internet Movie Database\]\]'
result = result .. wdIMDb
return result
end