Документацію для цього модуля можна створити у Модуль:List/документація
local p = {}
function p.FetchData(frame)
local categoryName = "Учасники_спільноти_MCC" -- category name as per your URL
local titles = mw.site.stats.getPagesInCategory(categoryName, "pages")
-- Start the wikitable
local output = '{| class="wikitable"\n'
output = output .. '! Nickname !! Prize Pool !! Date Added !! Recruiter\n'
-- Process each page in the category
for _, pageTitle in ipairs(titles) do
local pageContent = mw.title.new(pageTitle):getContent()
-- Extract data using patterns
local nickname = pageContent:match("| nickname = ([^\n]+)")
local prizePool = pageContent:match("| prize_pool = ([^\n]+)")
local dateAdded = pageContent:match("| date_added = ([^\n]+)")
local recruiter = pageContent:match("| recruiter = %[%[([^|%]]+)|")
-- Append to the table
output = output .. '|-\n'
output = output .. string.format('| %s || %s || %s || %s\n', nickname or 'N/A', prizePool or 'N/A', dateAdded or 'N/A', recruiter or 'N/A')
end
-- Close the wikitable
output = output .. '|}'
return output
end
return p