Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Test: Difference between revisions

From Kronopolis and the Flat Plane
No edit summary
No edit summary
Line 2: Line 2:


local util = require('Module:Utility')
local util = require('Module:Utility')
local api = mw.Api


function p.test(frame)
function p.test(frame)


     local out = {}
     local out = {}
     local params = {
     local data = mw.loadData(util.firstToUpper(frame.args[1]))
        action = 'query',
        format = 'json',
        list = 'categorymembers',
        cmtitle = 'Category:' .. util.firstToUpper(frame.args[1]),
        cmlimit = 'max'
    }


     local result = api:request(params)
     out = util.dump(data)
    if result and result.query and result.query.categorymembers then
        -- Process the search results
        for _, page in ipairs(result.query.categorymembers) do
            table.insert(out, page.title .. '\n')
        end
    end
     return out
     return out
end
end


return p
return p

Revision as of 09:39, 4 September 2025

Documentation for this module may be created at Module:Test/doc

local p = {}

local util = require('Module:Utility')

function p.test(frame)

    local out = {}
    local data = mw.loadData(util.firstToUpper(frame.args[1]))

    out = util.dump(data)
    return out
end

return p