Module:NUMBEROF: Difference between revisions

Content deleted Content added
did that break?
try again
Line 49:
 
local function main(frame)
local countWordsmetaWords = { active = true, closed = true, languages = true, }
local args = frame:getParent().args
local action = trimArg(args[1], 1) -- activeusers, admins, articles, edits, files, pages, users, depth, active, closed, languages
if action:sub(1, 8) == 'numberof' then -- numberofX is an alias for X
action = trimArg(action:sub(9), 1)
end
local wantCountwantMeta = countWordsmetaWords[action]
local site = trimArg(args[2], 2)
if not wantCountwantMeta and not site:find('.', 1, true) then
-- site is like "af" or "af.wikipedia" or "af.wikiquote" etc., including "total"
site = site .. '.wikipedia'
Line 63:
local wantComma = trimArg(args[3]) -- nil for no commas in output; "N" or anything nonblank inserts commas
local result
if wantCountwantMeta then
local data = mw.loadData('Module:NUMBEROF/meta')
local nrActive = data.nrActive[site]