Modulo:Sandbox/Sakretsu: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
+ |
+ |
||
Riga 4:
local content = mw.title.new('Wikipedia:Amministratori/Sistema_di_voto/Quorum'):getContent()
local quorum = 0
local pages, users, hash = {}, {}, {}
for page in string.gmatch(content, '%[%[(W%a+:Amministratori/Elezioni/.-)[|%]]') do
table.insert(pages, page)
Riga 11:
end
if #pages ~= 8 then
return error('Non è stato trovato un elenco di 8
end
for _, page in ipairs(pages) do
content = mw.title.new(page):getContent()
if not content then
return error('Non è stata trovata la pagina della
end
if hash[page] then
return error('È stata elencata più volte la seguente elezione: ' .. page)
end
hash[page] = true
content = content:gsub('(\n==+ *[^\n]- *==+)', '\r%1')
for heading, section in string.gmatch(content, '\n==+ *([^\n]-) *==+(.-)\r') do
|