Created page with "local p = {} local util = require('Module:Utility') function p.list(frame) local out = {} local payload = { source=mw.site.server .. mw.site.scriptPath .. '/api.php?action=query&format=json&generator=categorymembers&gcmlimit=max&gcmtitle=Category:' .. util.firstToUpper(frame.args.category), format='json' } local json = mw.ext.externalData.getExternalData(payload) for _,feat in ipairs(json) do if feat['title'] ~= nil then..." |
No edit summary |
||
Line 6: | Line 6: | ||
local out = {} | local out = {} | ||
local payload = { | local payload = { | ||
source=mw.site.server .. mw.site.scriptPath .. '/api.php?action=query&format=json&generator=categorymembers&gcmlimit=max&gcmtitle=Category:' .. util.firstToUpper(frame.args | source=mw.site.server .. mw.site.scriptPath .. '/api.php?action=query&format=json&generator=categorymembers&gcmlimit=max&gcmtitle=Category:' .. util.firstToUpper(frame.args[1]), | ||
format='json' | format='json' | ||
} | } |
Revision as of 17:29, 15 March 2023
Documentation for this module may be created at Module:Feat/doc
local p = {} local util = require('Module:Utility') function p.list(frame) local out = {} local payload = { source=mw.site.server .. mw.site.scriptPath .. '/api.php?action=query&format=json&generator=categorymembers&gcmlimit=max&gcmtitle=Category:' .. util.firstToUpper(frame.args[1]), format='json' } local json = mw.ext.externalData.getExternalData(payload) for _,feat in ipairs(json) do if feat['title'] ~= nil then table.insert(out, frame:preprocess("\n=='''[[" .. feat['title'] .. "]]'''==\n")) table.insert(out, frame:expandTemplate({title=':' .. feat['title']})) table.insert(out, frame:preprocess("\n----")) end end return table.concat(out) end return p