打开/关闭菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

模块:Unown/Utils:修订间差异

来自Cookie☆Wiki
无编辑摘要
无编辑摘要
第19行: 第19行:
if offset ~= nil then rawTitle = rawTitle .. '&offset=' .. offset end
if offset ~= nil then rawTitle = rawTitle .. '&offset=' .. offset end
local pageTitleObj = mw.title.new(rawTitle, Special)
local pageTitleObj = mw.title.new(rawTitle, Special)
local pageContent = pageTitleObj.getContent()
local pageContent = pageTitleObj:getContent()
return '<nowiki>' .. pageContent .. '</nowiki>'
return '<nowiki>' .. pageContent .. '</nowiki>'
end
end

2019年1月17日 (四) 01:26的版本

可在模块:Unown/Utils/doc创建此模块的帮助文档

local p = {}

function p.test() --p.getEditCounts()
    local frame = mw.getCurrentFrame()
    --local parent = frame:getParent()

    local offset = nil
    local namespace = nil
    local userName = 'UnownHearn'

    local namespaceID = nil
    if namespace ~= nil then
        namespaceID = mw.site.namespaces[namespace].id
    end

    while true do
        local rawTitle = 'Contributions/' .. userName .. '?limit=500'
        if namespaceID ~= nil then rawTitle = rawTitle .. '&namespace=' .. namespaceID end
        if offset ~= nil then rawTitle = rawTitle .. '&offset=' .. offset end
        local pageTitleObj = mw.title.new(rawTitle, Special)
        local pageContent = pageTitleObj:getContent()
        return '<nowiki>' .. pageContent .. '</nowiki>'
    end
end

return p