Content deleted Content added
minor tweak to match a change at meta |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1:
-- Return a table of statistics to be accessed once per page using mw.loadData.
--
local
'wikipedia',
local statistics = mw.ext.data.get('Wikipedia statistics/datarank.tab') -- https://commons.wikimedia.org/wiki/Data:Wikipedia_statistics/datarank.tab▼
}
local function getData(statistics)
local iSite, iArticles
for i, v in ipairs(statistics.schema.fields) do
Line 18 ⟶ 21:
end
return {
rankByIndex = rankByIndex, -- rankByIndex[1] == 'en
rankBySite = rankBySite, -- rankBySite['en
}
end
local function makeData()
-- For example, data to rank each language for sister project wikipedia is at
▲
local result = {}
for _, project in ipairs(projects) do
result[project] = getData(mw.ext.data.get('Wikipedia statistics/rank/' .. project .. '.tab'))
end
return result
end
|