Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:XfD old/AfD and MfD/sandbox
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = {} -- RfD is even worse, since we have to manually parse all log pages -- and "Old" discussions aren't displayed separately from "Current" ones function p.rfd(frame) local month = frame.args.month local rfd = "Wikipedia:Redirects for discussion" local logprefix = "Wikipedia:Redirects for discussion/Log/" -- threshold is 7 days ago local threshold = os.date("%F",os.time() - (86400*7)) local ymd = require("Module:YMD to ISO")._main local lang = mw.getContentLanguage() -- Find the daily pages local content = mw.title.new(rfd):getContent() local dayPattern = "{{" .. logprefix .. "(.-)}}"; local total = 0 local lastTitle for day in content:gmatch(dayPattern) do local datestamp = ymd(day) if datestamp >= threshold then -- These discussions aren't seven days old yet elseif month == "total" or month == lang:formatDate("F Y", datestamp) then local dayTitle = logprefix .. day; local dayContent = mw.title.new(dayTitle):getContent() -- Match only title sections starting with lists or templates local titlePattern = "==== ?([^\n]-) ?====%s+[%*#{]"; for title in dayContent:gmatch(titlePattern) do total = total + 1 lastTitle = title end end end if month == "total" then if total > 0 then return "[[" .. rfd .. "#" .. lastTitle .. "|" .. total .. "]]" else return "[[" .. rfd .. "|0]]" end else return total end end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:XfD old/AfD and MfD/sandbox/doc
(
edit
)