local getArgs = require('Module:Arguments').getArgs
local p = {}

function p.main(frame)
	local t = getArgs(frame)
	local dato = t[1]
	
	local entity2= mw.wikibase.getEntity( dato )
	local count = 0
	if entity2.sitelinks == nil then
		return '[[:D:' .. dato .. ']] Nessun link'
	else
		for i, j in pairs(entity2.sitelinks) do
			count=count+1
		end
		return 'Su Wikidata:[[:D:' .. dato .. '|' .. dato .. ']] - N° di link: ' .. count
	end
end

return p