Module:XfD old/AfD and MfD explained

-- Various hacky solutions to allow AfD and MfD to show up on -- AfD is easy, as already summarizes the total on each daylocal p = local lang = mw.getContentLanguagefunction p.afd(frame) local month = frame.args.month local pat if month

"total" then pat = "%(([0-9]+) open" else month = lang:formatDate("Y F", month) pat = "%[%[Wikipedia:Articles for deletion/Log/" .. month .. "[^%]]*%]%] %(([0-9]+) open /" end local content = mw.title.new("Wikipedia:Articles for deletion/Old"):getContent local count = 0 for daycount in content:gmatch(pat) do count = count + daycount end return countend-- MfD is much harder, because the only list of all active MfDs is the main-- page itselffunction p.mfd(frame) local month = frame.args.month local content = mw.title.new("Wikipedia:Miscellany for deletion"):getContent local rightmonth = true local pat; if month ~= "total" then pat = lang:formatDate("^

?F [0-9]*, Y ?

$", month) rightmonth = false end local _, endindex = content:find("

Old business

") local count = 0 for line in mw.text.gsplit(content:sub(endindex,#content), "\n") do if line:find("