Модуль:RandomMembers
Документацію для цього модуля можна створити у Модуль:RandomMembers/документація
local p = {}
function p.showRandomMembers(frame)
local count = 4 -- Number of random members to display
local category = 'Учасники_спільноти_MCC' -- The category to fetch from
local pages = mw.site.pagesInCategory(category)
local output = {}
local displayed = {}
-- Fetching random pages
for i = 1, math.min(count, #pages) do
local index = math.random(#pages)
while displayed[index] do
index = math.random(#pages)
end
displayed[index] = true
local title = pages[index].title
table.insert(output, string.format('<p>[[%s|%s]]</p>', title, title))
end
return table.concat(output, "\n")
end
return p