Jump to content

Module:RfX tally

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Pppery (talk | contribs) at 19:20, 3 July 2021. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
local rfx = require("Module:Rfx")
function p.main(frame)
	local title = mw.text.trim(frame.args[1])
	local obj
	if title == nil or #title == 0 then
		obj = rfx.new(mw.title.getCurrentTitle())
	else
		obj = rfx.new("Wikipedia:Requests for bureaucratship/" .. title)
		if obj == nil then
			obj = rfx.new("Wikipedia:Requests for adminship/" .. title)
		end	
	end
	if obj == nil then
		return "(?/?/?)"
	else
		return string.format("(%s/%s/%s)",obj.supports,obj.opposes,obj.neutrals)
	end
end
return p