编辑“模块:UserlinkUserEditCount”
该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第7行: | 第7行: | ||
end | end | ||
local apiUrl = mw.uri.fullUrl('api.php', { | |||
action = 'query', | |||
list = 'usercontribs', | |||
ucuser = username, | |||
uclimit = 'max', | |||
ucnamespace = 0, | |||
format = 'json' | |||
}) | |||
local result = mw.http.fetch(apiUrl) | |||
if result and result.status == 200 then | |||
local data = mw.text.jsonDecode(result.body) | |||
if data and data.query and data.query.usercontribs then | |||
local editCount = #data.query.usercontribs | |||
return "用户 " .. username .. " 的编辑总数为: " .. editCount | |||
end | |||
end | |||
return "无法获取用户编辑总数" | |||
end | end | ||
return p | return p |