Modulo:Demografia: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
fix recupero dati da wikidata |
r |
||
Riga 202:
return years, populations
end
local function comp_year(a1, a2)
return a1[1] < a2[1]
end
local function get_wikidata(from)
Riga 214 ⟶ 219:
end
--if true then return mw.text.jsonEncode(claims[1],mw.text.JSON_PRETTY) end
local
local populations = {}▼
for _,claim in ipairs(claims) do
if claim.qualifiers and claim.qualifiers.P585 and (claim.rank == 'preferred' or claim.rank == 'normal') then
--if true then return claim end
end
end
table.sort(raw_data, comp_year)
local years = {}
local j=#populations-i+1▼
▲ local populations = {}
for i,data in ipairs(raw_data) do
end
return years, populations
|