local p =
local sub = mw.ustring.sublocal find = mw.ustring.findlocal gmatch = mw.ustring.gmatchlocal match = mw.ustring.matchlocal trim = mw.text.trimlocal insert = table.insertlocal concat = table.concat
function p.caserequests (frame) frame = frame or mw.getCurrentFrame local page = mw.title.new('Wikipedia:Arbitration/Requests/Case'):getContent local re = '\n
' local sections = local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = end until not loc for i=1, count, 1 do local sec = sections[i] local content = if sections[i+1] then content = sub(page, sec.start, sections[i+1].start) else content = sub(page, sec.start) end local redate = '%d%d?%s%a*%s%d%d%d%d%f[(%s%(UTC%)]' sec.date = match(content, redate) local remotion = '\n
?' local m = match(content, remotion) if (m) then sec.motion = trim(m) end local revotes = '\n
' sec.votes = match(content, revotes) end
local result = for i=1, count, 1 do local sec = sections[i] local s = frame:expandTemplate insert(result, s) end return concat(result, '\n')end
function p.arca (frame) frame = frame or mw.getCurrentFrame local page = mw.title.new('Wikipedia:Arbitration/Requests/Clarification and Amendment'):getContent local re = '\n
' local sections = local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = end until not loc for i=1, count, 1 do local sec = sections[i] local content = if sections[i+1] then content = sub(page, sec.start, sections[i+1].start) else content = sub(page, sec.start) end local redate = '%d%d?%s%a*%s%d%d%d%d%f[(%s%(UTC%)]' sec.date = match(content, redate)
local remotion = '\n
?' local m = match(content, remotion) if (m) then sec.motion = trim(m) end local relink = '' sec.link = match(content, relink) end
local result = for i=1, count, 1 do local sec = sections[i] local s = frame:expandTemplate insert(result, s) end return concat(result, '\n')end
function p.motions (frame) frame = frame or mw.getCurrentFrame local page = mw.title.new('Wikipedia:Arbitration/Requests/Motions'):getContent local re = '\n
' local sections = local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = end until not loc for i=1, count, 1 do local sec = sections[i] local content = if sections[i+1] then content = sub(page, sec.start, sections[i+1].start) else content = sub(page, sec.start) end local redate = '%d%d?%s%a*%s%d%d%d%d%f[(%s%(UTC%)]' sec.date = match(content, redate) end
local result = for i=1, count, 1 do local sec = sections[i] local s = frame:expandTemplate insert(result, s) end return concat(result, '\n')end
return p