local randoms = mw.loadData 'Module:Featured picture list/randoms'
local dates = mw.loadData 'Module:Featured picture list/dates'
local p = {}
function p.main(frame)
local lang = mw.language.getContentLanguage()
local year = lang:formatDate('Y', nil, true)
local month = lang:formatDate('n', nil, true)
local day = lang:formatDate('j', nil, true)
if dates[year] and dates[year][month] and dates[year][month][day] then
return frame:preprocess(dates[year][month][day])
elseif dates['any'] and dates['any'][month] and dates['any'][month][day] then
return frame:preprocess(dates['any'][month][day])
end
local edits = mw.site.stats.edits
local title = randoms[edits % randoms.length + 1]
return frame:expandTemplate {title = title}
end
return p