local function remove_wiki_link (str) return (str:gsub("%[%[([^%[%]]*)%]%]", function(l) return l:gsub("^[^|]*|(.*)$", "%1"):gsub("^%s*(.-)%s*$", "%1"); end));end
local function main (frame) local user = frame.args[1] local page = local i = 1 local content repeat content = mw.title.new (page[i]):getContent; if string.find(content, "|"..user.."]]\n") or string.find(content, "| "..user.."\n") then pgnum = i else if i
i - 1) or (pgnum
0 then outputRank = "nil" outputName = user outputCount = "nil" else for rank, name, count in string.gmatch(content, "|%-\n|%s(.-)\n|%s(.-)\n|%s(.-)\n") do rank = mw.text.trim(rank) name = mw.text.trim(name) count = mw.text.trim(count) name = remove_wiki_link (name) if name
"rank" then return outputRank elseif frame.args[2]
return