Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:ArbComOpenTasks
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} local sub = mw.ustring.sub local find = mw.ustring.find local gmatch = mw.ustring.gmatch local match = mw.ustring.match local trim = mw.text.trim local insert = table.insert local 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==%f[^=](.-)==' local sections = {} local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = { id = count, start = loc, title = trim(match(page, re, loc)) } 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====?([^\n]*[Mm]otion[^\n]-)====?' local m = match(content, remotion) if (m) then sec.motion = trim(m) end local revotes = '\n===[^\n]*<(%d+/%d+/%d+)>%s*===' sec.votes = match(content, revotes) end local result = {} for i=1, count, 1 do local sec = sections[i] local s = frame:expandTemplate{ title = 'ArbComOpenTasks/line', args = { mode = 'caserequest', name = sec.title, date = sec.date, motion = sec.motion, votes = sec.votes } } 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==%f[^=](.-)==' local sections = {} local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = { id = count, start = loc, title = trim(match(page, re, loc)) } 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====?([^\n]*[Mm]otion[^\n]-)====?' local m = match(content, remotion) if (m) then sec.motion = trim(m) end local relink = '{{RFARlinks%|(.-)}}' sec.link = match(content, relink) end local result = {} for i=1, count, 1 do local sec = sections[i] local s = frame:expandTemplate{ title = 'ArbComOpenTasks/line', args = { mode = 'amendment', name = sec.title, date = sec.date, motion = sec.motion, link = sec.link } } 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==%f[^=](.-)==' local sections = {} local count, loc = 0, 0 repeat loc = find(page, re, loc+1) if (loc) then count = count + 1 sections[count] = { id = count, start = loc, title = trim(match(page, re, loc)) } 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{ title = 'ArbComOpenTasks/line', args = { mode = 'motion', name = sec.title, date = sec.date, } } insert(result, s) end return concat(result, '\n') end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Module other
(
edit
)
Template:Module rating
(
edit
)
Template:Ombox
(
edit
)
Module:ArbComOpenTasks/doc
(
edit
)
Module:Arguments
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:Yesno
(
edit
)