Modulo:Sandbox/ValterVB: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
.
 
(36 versioni intermedie di 2 utenti non mostrate)
Riga 1:
local getArgs = require('Module:Arguments').getArgs
local p = {}
 
function p.IMDbmain(frame)
local tipot = getArgs(frame.args['tipo'])
local iddato = frame.argst['id'1]
local pagina = mw.title.getCurrentTitle() --nome della pagina
local entity2= mw.wikibase.getEntity( dato )
local result = '* (\'\'\'EN\'\'\') Scheda su \'\'[http://www.imdb.com/'
local count = 0
if tipo == 'titolo' or tipo == 'film' then
local ris = '[[File:Wikidata-logo.svg|20px]] Su Wikidata: '
tipo = 'title/tt'
wpIMDb = 'tt' .. id -- codice IMDb presente su Wikipedia
if elseif tipodato == 'compagnia'nil then
ris = ris .. 'n° item mancante'
tipo = 'company/co'
else
wpIMDb = 'co' .. id -- codice IMDb presente su Wikipedia
if elseif tipoentity2 == 'nome'nil then
ris = ris..'Non esiste'
tipo = 'name/nm'
else
wpIMDb = 'nm' .. id -- codice IMDb presente su Wikipedia
ris = ris..'[[:D:' .. dato .. '|' .. dato .. ']] - N° di link: '
elseif tipo == 'personaggio' then
if entity2.sitelinks == nil then
tipo = 'character/ch'
ris = ris..'nessuno'
wpIMDb = 'ch' .. id
else
end
for _ in pairs(entity2.sitelinks) do
count=count+1
local wdIMDb = frame:preprocess("{{#property:P345}}") -- codice IMDb presente su Wikidata
end
ris = ris..count
result = result .. tipo .. id
end
result = result .. '/ '
end
result = result .. pagina.text
end
result = result .. ']\'\' dell\'\[\[Internet Movie Database\]\]'
return resultris
result = result .. Categoria
return result
end