<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AXfD_old%2FAfD_and_MfD</id>
	<title>Module:XfD old/AfD and MfD - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AXfD_old%2FAfD_and_MfD"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:XfD_old/AfD_and_MfD&amp;action=history"/>
	<updated>2026-05-24T16:18:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:XfD_old/AfD_and_MfD&amp;diff=147743&amp;oldid=prev</id>
		<title>imported&gt;Pppery: Add RfD</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:XfD_old/AfD_and_MfD&amp;diff=147743&amp;oldid=prev"/>
		<updated>2022-02-01T01:14:41Z</updated>

		<summary type="html">&lt;p&gt;Add RfD&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Various hacky solutions to allow AfD and MfD to show up on [[Template:XFD Backlog]]&lt;br /&gt;
-- AfD is easy, as [[User:Mathbot]] already summarizes the total on each day&lt;br /&gt;
local p = {}&lt;br /&gt;
local lang = mw.getContentLanguage()&lt;br /&gt;
function p.afd(frame) &lt;br /&gt;
	local month = frame.args.month&lt;br /&gt;
	local pat&lt;br /&gt;
	if month == &amp;quot;total&amp;quot; then&lt;br /&gt;
		pat = &amp;quot;%(([0-9]+) open&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		month = lang:formatDate(&amp;quot;Y F&amp;quot;, month)&lt;br /&gt;
		pat = &amp;quot;%[%[Wikipedia:Articles for deletion/Log/&amp;quot; .. month .. &amp;quot;[^%]]*%]%] %(([0-9]+) open /&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local content = mw.title.new(&amp;quot;Wikipedia:Articles for deletion/Old&amp;quot;):getContent()&lt;br /&gt;
	local count = 0&lt;br /&gt;
	for daycount in content:gmatch(pat) do&lt;br /&gt;
		count = count + daycount&lt;br /&gt;
	end&lt;br /&gt;
	return count&lt;br /&gt;
end&lt;br /&gt;
-- MfD is much harder, because the only list of all active MfDs is the main&lt;br /&gt;
-- [[Wikipedia:Miscellany for deletion]] page itself&lt;br /&gt;
function p.mfd(frame)&lt;br /&gt;
	local month = frame.args.month&lt;br /&gt;
	local content = mw.title.new(&amp;quot;Wikipedia:Miscellany for deletion&amp;quot;):getContent()&lt;br /&gt;
	local rightmonth = true&lt;br /&gt;
	local pat;&lt;br /&gt;
	if month ~= &amp;quot;total&amp;quot; then&lt;br /&gt;
		pat = lang:formatDate(&amp;quot;^=== ?F [0-9]*, Y ?===$&amp;quot;, month)&lt;br /&gt;
		rightmonth = false&lt;br /&gt;
	end&lt;br /&gt;
	local _, endindex = content:find(&amp;quot;==Old business==&amp;quot;)&lt;br /&gt;
	local count = 0&lt;br /&gt;
	for line in mw.text.gsplit(content:sub(endindex,#content), &amp;quot;\n&amp;quot;) do&lt;br /&gt;
		if line:find(&amp;quot;{{Wikipedia:Miscellany for deletion/&amp;quot;) and rightmonth then&lt;br /&gt;
			count = count + 1&lt;br /&gt;
		elseif month == &amp;quot;total&amp;quot; then&lt;br /&gt;
			-- don&amp;#039;t worry about month section headers&lt;br /&gt;
		elseif line:find(pat) then&lt;br /&gt;
			rightmonth = true&lt;br /&gt;
		elseif line:find(&amp;quot;=== ?.* ?===&amp;quot;) then&lt;br /&gt;
			-- A section header for the wrong month&lt;br /&gt;
			if rightmonth then&lt;br /&gt;
				-- We&amp;#039;re now looking at MfDs before the month in question&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
			-- We still haven&amp;#039;t reached the month in question yet&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return count&lt;br /&gt;
end&lt;br /&gt;
-- RfD is even worse, since I have to manually parse all log pages&lt;br /&gt;
-- and &amp;quot;Old&amp;quot; discussions aren&amp;#039;t displayed separately from &amp;quot;Current&amp;quot; ones&lt;br /&gt;
function p.rfd(frame)&lt;br /&gt;
	local month = frame.args.month&lt;br /&gt;
	local content = mw.title.new(&amp;quot;Wikipedia:Redirects for discussion&amp;quot;):getContent()&lt;br /&gt;
	-- First find the daily pages&lt;br /&gt;
	local ymd = require(&amp;quot;Module:YMD to ISO&amp;quot;)._main&lt;br /&gt;
	local lang = mw.getContentLanguage()&lt;br /&gt;
	local threshold = os.date(&amp;quot;%F&amp;quot;,os.time() - (86400*7))&lt;br /&gt;
	local total = 0&lt;br /&gt;
	for line in content:gmatch(&amp;quot;{{Wikipedia:Redirects for discussion/Log/.-}}&amp;quot;) do&lt;br /&gt;
		local datestamp = ymd(line:match(&amp;quot;{{Wikipedia:Redirects for discussion/Log/(.-)}}&amp;quot;))&lt;br /&gt;
		if datestamp &amp;gt;= threshold then&lt;br /&gt;
			-- These dicussions aren&amp;#039;t seven days old yet&lt;br /&gt;
		elseif month == &amp;quot;total&amp;quot; or month == lang:formatDate(&amp;quot;F Y&amp;quot;, datestamp) then&lt;br /&gt;
			local dayContent = mw.title.new(line:match(&amp;quot;{{(.*)}}&amp;quot;)):getContent()&lt;br /&gt;
			-- unreliable but performance is important&lt;br /&gt;
			local _, sectionHeads = dayContent:gsub(&amp;quot;==== ?[^\n]- ?====&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			local _, closeBoxes = dayContent:gsub(&amp;quot;boilerplate rfd vfd xfd%-closed&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			local _, relisted = dayContent:gsub(&amp;quot;%[%[File:Symbol move vote.svg|16px|link=|alt=%]%] &amp;#039;&amp;#039;&amp;#039;Relisted&amp;#039;&amp;#039;&amp;#039;&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			total = total + (sectionHeads - closeBoxes - relisted)&lt;br /&gt;
		-- else discussion is wrong month&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return total&lt;br /&gt;
end&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Pppery</name></author>
	</entry>
</feed>