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'
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
for _ in pairs(entity2.sitelinks) do
count=count+1
local wdIMDb = frame:preprocess("{{#property:P345}}") -- codice IMDb presente su Wikidata
if wdIMDB == '' then
ris = ris..count
Categoria = '\[\[Categoria:Codice IMDB non presente in Wikidata\]\]'
end
elseif wdIMDB ~= wpIMDb then
Categoria = '\[\[Categoria:Codice IMDB in Wikidata differente\]\]'
end
Categoria = '\[\[Categoria:Codice IMDB uguale in Wikidata\]\]'
result = result .. tipo .. id
result = result .. '/ '
result = result .. pagina.text
result = result .. ']\'\' dell\'\[\[Internet Movie Database\]\]'
result = result --.. Categoria
end
|