localp={}-- RfD is even worse, since we have to manually parse all log pages-- and "Old" discussions aren't displayed separately from "Current" onesfunctionp.rfd(frame)localmonth=frame.args.monthlocalrfd="Wikipedia:Redirects for discussion"locallogprefix="Wikipedia:Redirects for discussion/Log/"-- threshold is 7 days agolocalthreshold=os.date("%F",os.time()-(86400*7))localymd=require("Module:YMD to ISO")._mainlocallang=mw.getContentLanguage()-- Find the daily pageslocalcontent=mw.title.new(rfd):getContent()localdayPattern="{{"..logprefix.."(.-)}}";localtotal=0locallastTitlefordayincontent:gmatch(dayPattern)dolocaldatestamp=ymd(day)ifdatestamp>=thresholdthen-- These discussions aren't seven days old yetelseifmonth=="total"ormonth==lang:formatDate("F Y",datestamp)thenlocaldayTitle=logprefix..day;localdayContent=mw.title.new(dayTitle):getContent()-- Match only title sections starting with lists or templateslocaltitlePattern="==== ?([^\n]-) ?====%s+[%*#{]";fortitleindayContent:gmatch(titlePattern)dototal=total+1lastTitle=titleendendendifmonth=="total"theniftotal>0thenreturn"[["..rfd.."#"..lastTitle.."|"..total.."]]"elsereturn"[["..rfd.."|0]]"endelsereturntotalendendreturnp