Module:MHGraph
From Comprehensible Input Wiki
Documentation for this module may be created at Module:MHGraph/doc
local p = {}
function createTable()
local g = mw.ext.externaldata.getWebData {
url = 'https://meta.miraheze.org/w/api.php?action=wikidiscover&wdsiteprop=creation&format=json&wdlimit=5000',
data = {creation},
format = 'JSON'
}
list = {}
for key, value in ipairs(g) do
table.insert(list, value['creation'])
end
table.sort(list)
return list
end
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
function json(o)
local s = ''
for k,v in pairs(o) do
s = s .. v .. ', ' .. k .. '\n'
end
return s
end
p.showList = function()
return json(createTable())
end
return p