Module:Sandbox/SilverLocust explained

local getArgs = require('Module:Arguments').getArgs

local p =

function p.main(frame) local args = getArgs(frame) local page = args["page"] or "ARCA" local section = args["section"] or "" local pattern = args["pattern"] or "" local ret = args["ret"] or "" if page

"ARCA" then page = "Wikipedia:Arbitration/Requests/Clarification and Amendment" elseif page

"ARM" then page = "Wikipedia:Arbitration/Requests/Motions" elseif page

"ARC" then page = "Wikipedia:Arbitration/Requests/Case" end

local text = mw.title.new(page):getContent local escape = mw.ustring.gsub(section, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1") local sectionText = mw.ustring.gsub(text, ".*%=%= *"..escape, "") sectionText = mw.ustring.gsub(sectionText, ";Arbitrator discussion.*", "") local supportText = mw.ustring.gsub(sectionText, ".*;Support", "Support") supportText = mw.ustring.gsub(supportText, ";Oppose.*", "") local _, support = mw.ustring.gsub(supportText, pattern, "") local opposeText = mw.ustring.gsub(sectionText, ".*;Oppose", "Oppose") opposeText = mw.ustring.gsub(opposeText, ";Abstain.*", "") local _, oppose = mw.ustring.gsub(opposeText, pattern, "") local abstainText = mw.ustring.gsub(sectionText, ".*;Abstain", "Abstain") local _, abstain = mw.ustring.gsub(abstainText, pattern, "") if ret

"support" then return support elseif ret

"oppose" then return oppose elseif ret

"abstain" then return abstain else return "" endend

return p