Content deleted Content added
comments |
fix leaderboard module title |
||
(14 intermediate revisions by 4 users not shown) | |||
Line 1:
-- Get the raw leaderboard content.
local
end▼
-- Get the rank and uses for a given username.▼
return error('No username specified')▼
end▼
▲ error('Could not find the leaderboard text')
end▼
function p.rank(frame)▼
local username = frame.args[1]▼
local function
username
local r = {}
r.rank, r.uses, r.vand, r.agf, r.queue, r.first, r.last, r.avg, r.yest, r.last30 = string.match(
lbtext,
'\n| align=center | (%d+) || align=left | %[%[User:' .. username .. '|' .. username ..
'%]%] %(%[%[User_Talk:' .. username .. '|talk%]%] | %[%[Special:Contributions/' ..
username .. '|contribs%]%]%) || align=right | (%d+) || align=right | ([%d%.]+)%% ' ..
'|| align=right | ([%d%.]+)%% || align=center | (%S+) || align=right ' ..
'| {{ntsh|%d+}} (%d+) days ago || align=right | {{ntsh|%d+}} (%d+) days ago || align=right ' ..
'| {{ntsh|[%d%.]+}} ([%d%.]+) edits || align=right | (%d+) || align=right | (%d+)'
)
end
-- Expose the data values to wikitext
▲return p
return setmetatable({}, {
__index = function (t, key)
username = mw.getContentLanguage():ucfirst(mw.text.trim(username))
if username == '' then
return findLeaderboardData(key, username)
▲ end
})
|