Module talk:XfD old
Feature request: monthly totals
Hey @Pppery, great work creating this module.
I have a feature request: monthly totals.
It looks like it would be a small extra bit of coding, and it would be very handy to have e.g. at WP:Categories for discussion/Working#Discussions_awaiting_closure a quick summary of the form:
- January 2019: 14
- February 2019: 589,704
- March 2019: 26
Even better, if there was a "totals only" parameter, then it could be wrapped in a template to make a wee indicator box for editors and admins to display on their userpages, just as many people display article alerts, WP:CENT etc. --BrownHairedGirl (talk) • (contribs) 00:48, 15 March 2019 (UTC)
- PS Even better: if there was a "month" parameter to tally just one month (e.g. "month=201901"), then we could build a combined totals indicator templates for all XFDs which the module support, with a column for the current month and each of the previous three months. --BrownHairedGirl (talk) • (contribs) 00:59, 15 March 2019 (UTC)
@BrownHairedGirl: Is
{{#invoke:XfD old/sandbox|bymonth}}
what you're looking for? {{3x|p}}ery (talk) 01:33, 15 March 2019 (UTC)
- Brilliant, @Pppery.
- That's my first request sorted in double-quick time. Thanks.
- Would I be pushing my luck to ask if the "month=" param is doable without too much grief? --BrownHairedGirl (talk) • (contribs) 01:38, 15 March 2019 (UTC)
- I'm currently in the process of coding this. {{3x|p}}ery (talk) 01:41, 15 March 2019 (UTC)
- @BrownHairedGirl: Done. Ex:
{{#invoke:XfD old/sandbox|onemonth|month=March 2019|title=Wikipedia:Categories for discussion}}
-> 0 {{3x|p}}ery (talk) 01:50, 15 March 2019 (UTC)- Brilliant, @Pppery. Please can it go live? --BrownHairedGirl (talk) • (contribs) 01:54, 15 March 2019 (UTC)
Done. {{3x|p}}ery (talk) 01:56, 15 March 2019 (UTC)
Wonderful, @Pppery!
{{XFD backlog}} →
V | Mar | Apr | May | Jun | Total |
---|---|---|---|---|---|
CfD | 0 | 0 | 39 | 0 | 39 |
TfD | 0 | 1 | 16 | 0 | 17 |
MfD | 0 | 0 | 6 | 0 | 6 |
FfD | 0 | 0 | 4 | 0 | 4 |
RfD | 0 | 0 | 17 | 0 | 17 |
AfD | 0 | 0 | 6 | 0 | 6 |
Are there any plans to support MfD and AFD? --BrownHairedGirl (talk) • (contribs) 02:16, 15 March 2019 (UTC)
- <discussion continues at #MfD and AfD>
@BrownHairedGirl: You should probably template-protect Module:XfD old; the template being protected but not the module is causing the template to be part of a a tracking category I created. {{3x|p}}ery (talk) 02:43, 15 March 2019 (UTC)
- @Pppery: Good idea. Done[1]. --BrownHairedGirl (talk) • (contribs) 02:48, 15 March 2019 (UTC)
MfD and AfD
- @BrownHairedGirl: The way the module is currently coded is incompatible with XfD forums that use subpages, so no. It could be theoretically expanded to support FfD and/or RfD if AnomieBOT were updated to create the necessary
/Old unclosed discussions
pages. {{3x|p}}ery (talk) 02:25, 15 March 2019 (UTC)- @BrownHairedGirl: I've changed my mind about this, and added the monthly backlog functionality for AfD and MfD in a separate module that shares no code with this one. {{3x|p}}ery (talk) 20:31, 15 March 2019 (UTC)
- @Pppery: I don't seem to be feeding it the right params. Pls can you show me a query or two? --BrownHairedGirl (talk) • (contribs) 20:48, 15 March 2019 (UTC)
- @BrownHairedGirl:
{{#invoke:XfD old/AfD and MfD|mfd|month=February 2019}}
-> 0. The same syntax works for AfD (useafd
instead ofmfd
), but it would always produce zero right now since there are literally zero AfDs awaiting closure. {{3x|p}}ery (talk) 20:52, 15 March 2019 (UTC)
- @BrownHairedGirl:
- @Pppery: I don't seem to be feeding it the right params. Pls can you show me a query or two? --BrownHairedGirl (talk) • (contribs) 20:48, 15 March 2019 (UTC)
- @BrownHairedGirl: I've changed my mind about this, and added the monthly backlog functionality for AfD and MfD in a separate module that shares no code with this one. {{3x|p}}ery (talk) 20:31, 15 March 2019 (UTC)
@Pppery, I have tested this at Template:XFD backlog/sandbox.
{{XFD backlog/sandbox}}
→
V | Mar | Apr | May | Jun | Total |
---|---|---|---|---|---|
CfD | 0 | 0 | 39 | 0 | 39 |
TfD | 0 | 1 | 16 | 0 | 17 |
MfD | 0 | 0 | 6 | 0 | 6 |
FfD | 0 | 0 | 4 | 0 | 4 |
RfD | 0 | 0 | 17 | 0 | 17 |
AfD | 0 | 0 | 6 | 0 | 6 |
Does this look OK? --BrownHairedGirl (talk) • (contribs) 21:02, 15 March 2019 (UTC)
- Yes. {{3x|p}}ery (talk) 21:03, 15 March 2019 (UTC)
- @BrownHairedGirl: {{3x|p}}ery (talk) 21:25, 15 March 2019 (UTC)
- @Pppery and BrownHairedGirl: well, I just discovered this thread, and thought I should share - Module:Sandbox/DannyS712/count has 2 functions, countMfD and countAfD, that return the total number of unclosed threads from those forums. Since those are usually processed faster, I didn't go through the trouble of splitting it up, but Mathbot updates the AfD count every few hours, and MfD is updated automatically (I think). Would it make sense to add an extra row, of AfD: #, and MfD: # or something? --DannyS712 (talk) 08:35, 13 April 2019 (UTC)
- Sounds v useful, @DannyS712. Can you tweak Module:Sandbox/DannyS712/count to do monthly totals? --BrownHairedGirl (talk) • (contribs) 08:41, 13 April 2019 (UTC)
- @BrownHairedGirl: that is wayyyy beyond my level of Lua. But, take a look at Template:XFD backlog/testcases for another idea --DannyS712 (talk) 08:42, 13 April 2019 (UTC)
- If I get the "green light" to add these, I'll clean up the Lua code and separate out the functions so they cane be added to the lua module already used for the backlog template. --DannyS712 (talk) 08:45, 13 April 2019 (UTC)
- Thanks, @DannyS712. I prefer preserving the one-venue-per-line format, which I have demoed at Template:XFD backlog/sandbox2 and included in Template:XFD backlog/testcases.
- What do you think of that? --BrownHairedGirl (talk) • (contribs) 08:57, 13 April 2019 (UTC)
- @BrownHairedGirl: I think it looks odd to include them so far to the right. Thats why I added the border, to delineate between the formats. That being said, I'm not particularly attached to my format, so if you think one-venue-per-line is better, I'm okay with that. However, can I suggest adding the border, and/or centering the totals? --DannyS712 (talk) 08:59, 13 April 2019 (UTC)
- If I get the "green light" to add these, I'll clean up the Lua code and separate out the functions so they cane be added to the lua module already used for the backlog template. --DannyS712 (talk) 08:45, 13 April 2019 (UTC)
- @BrownHairedGirl: that is wayyyy beyond my level of Lua. But, take a look at Template:XFD backlog/testcases for another idea --DannyS712 (talk) 08:42, 13 April 2019 (UTC)
- Sounds v useful, @DannyS712. Can you tweak Module:Sandbox/DannyS712/count to do monthly totals? --BrownHairedGirl (talk) • (contribs) 08:41, 13 April 2019 (UTC)
- @Pppery and BrownHairedGirl: well, I just discovered this thread, and thought I should share - Module:Sandbox/DannyS712/count has 2 functions, countMfD and countAfD, that return the total number of unclosed threads from those forums. Since those are usually processed faster, I didn't go through the trouble of splitting it up, but Mathbot updates the AfD count every few hours, and MfD is updated automatically (I think). Would it make sense to add an extra row, of AfD: #, and MfD: # or something? --DannyS712 (talk) 08:35, 13 April 2019 (UTC)
- @BrownHairedGirl: {{3x|p}}ery (talk) 21:25, 15 March 2019 (UTC)
- @DannyS712, now centered, but look at Template:XFD backlog/sandbox3, shown right and added to testcases. Includes totals for all venues. --BrownHairedGirl (talk) • (contribs) 09:26, 13 April 2019 (UTC)
- Better still, @DannyS712, here is Template:XFD backlog/sandbox4, shown left and added to testcases. Totals for all per v3, but omits the year to reduce bulk. I really like this. --BrownHairedGirl (talk) • (contribs) 09:34, 13 April 2019 (UTC)
- @BrownHairedGirl and DannyS712: You do realize that I coded a module that handles monthly totals for AfD and MfD a month ago. (FYI, I'm neutral between v4 and v3, and prefer them over v2/v1). * Pppery * fades away 15:45, 13 April 2019 (UTC)
- Duh. Sorry @Pppery, I had forgotten that. Brain fog.
- That's be Module:XfD old/AfD and MfD. Its undocumented, so please can you remind me again of the syntax for a) individual month, b) overall total. --BrownHairedGirl (talk) • (contribs) 15:53, 13 April 2019 (UTC)
- @BrownHairedGirl:
{{#invoke:XfD old/AfD and MfD|afd/mfd}}
,{{#invoke:XfD old/AfD and MfD|afd/mfd|month=total}}
(the later being a new feature I added just now) * Pppery * fades away 16:27, 13 April 2019 (UTC)- Thanks again, @Pppery. I have now updated {{XFD backlog}} with Template:XFD backlog/sandbox4, modified to use
{{#invoke:XfD old/AfD and MfD|afd/mfd}}
. --BrownHairedGirl (talk) • (contribs) 16:35, 13 April 2019 (UTC)- @BrownHairedGirl and Pppery: I agree that sandbox4 is the best. Thanks so much --DannyS712 (talk) 18:27, 13 April 2019 (UTC)
- Thanks again, @Pppery. I have now updated {{XFD backlog}} with Template:XFD backlog/sandbox4, modified to use
- @BrownHairedGirl:
- @BrownHairedGirl and DannyS712: You do realize that I coded a module that handles monthly totals for AfD and MfD a month ago. (FYI, I'm neutral between v4 and v3, and prefer them over v2/v1). * Pppery * fades away 15:45, 13 April 2019 (UTC)
Testcases
Testing an edit request
Template-protected edit request on 1 May 2019
![]() | This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Please replace with the current version of the sandbox (diff). This wraps the list outputs with {{Div col}} to reduce the height of the display and eliminate extraneous whitespace by using multiple columns. The results can be seen at the current #Testcases section above. Thanks, --DannyS712 (talk) 08:39, 1 May 2019 (UTC)
Not done This is out of scope for the module; it should be added to Wikipedia:Categories for discussion/Awaiting closure instead, if you can find consensus to do so there. * Pppery * has returned 11:40, 1 May 2019 (UTC)
Well, can't add FfD right now...
...Since their subpages do not include ".../Log/...". I'll have to see where this leads as I may try to change that. Steel1943 (talk) 18:54, 2 May 2019 (UTC)
- @Steel1943: it is possible, just requires a different approach. I'll work on it - I have some ideas --DannyS712 (talk) 18:55, 2 May 2019 (UTC)
- Awesome ... since the problem is clear, but I just don't know how to Lua. But, that may change by the end of this year. ☺️ Steel1943 (talk) 18:56, 2 May 2019 (UTC)
- @Steel1943 and DannyS712: If you're trying to add FfD, the bigger problem is that the bot doesn't create Wikipedia:Files for discussion/Old unclosed discussions. I could write code to handle the lack of the "/Log" fairly easily, but Anomie would need to make his bot create the /Old unclosed discussions subpage first. * Pppery * the end 21:10, 2 May 2019 (UTC)
- @Pppery: why would you need /Old unclosed discussions? you can retrieve the count of unclosed discussions by parsing Wikipedia:Files for discussion#Old discussions --DannyS712 (talk) 21:13, 2 May 2019 (UTC)
- @DannyS712: Because I don't want to right any more special-case code than I have to. * Pppery * the end 21:14, 2 May 2019 (UTC)
- @Pppery: why would you need /Old unclosed discussions? you can retrieve the count of unclosed discussions by parsing Wikipedia:Files for discussion#Old discussions --DannyS712 (talk) 21:13, 2 May 2019 (UTC)
- @Steel1943 and DannyS712: If you're trying to add FfD, the bigger problem is that the bot doesn't create Wikipedia:Files for discussion/Old unclosed discussions. I could write code to handle the lack of the "/Log" fairly easily, but Anomie would need to make his bot create the /Old unclosed discussions subpage first. * Pppery * the end 21:10, 2 May 2019 (UTC)
- Awesome ... since the problem is clear, but I just don't know how to Lua. But, that may change by the end of this year. ☺️ Steel1943 (talk) 18:56, 2 May 2019 (UTC)