Commons:Bots/Requests/Ahechtbot
Operator: Ahecht (talk · contributions · Statistics · Recent activity · block log · User rights log · uploads · Global account information)
Bot's tasks for which permission is being sought: Many of the pages in Category:Days by day contain both {{YMDcat}} and {{Date navbox}}, both of which have been outputting the current date into the category description. {{Date navbox}} also has output a navbox, which is more useful. I have now integrated {{YMDcat}} into {{Date navbox}} so that both are no longer needed on the same page.
- The first task of the bot is to go through all category pages that transclude {{Date navbox}} and remove {{YMDcat}}.
pwb.py replace -always -transcludes:Template:Date_navbox -ns:14 -log -v -summary:"Bot: Removing redundant {{[[Template:YMDcat|YMDcat]]}} template (v2)" -regex "{{YMDcat(.*?)}}\n{{Date navbox(.*?)}}|{{Date navbox(.*?)}}\n{{YMDcat(.*?)}}" "{{Date navbox\2\3}}"
- The second task of the bot is to then go through all the remaining category pages that transclude {{YMDcat}} and replace it with {{Date navbox}}
pwb.py replace -always -transcludes:Template:YMDcat -ns:14 -log -v -summary:"Bot: Replacing {{[[Template:YMDcat|YMDcat]]}} with {{[[Template:Date navbox|Date navbox]]}}" -regex "{{YMDcat\|(.*?)\|(.*?)\|(.*?)\|(.*?)}}" "{{Date navbox|\1\2|\3|\4}}"
Automatic or manually assisted: Bot will be started manually. Once it is running, pywikibot will continue automatically with occasional supervision.
Edit type (e.g. Continuous, daily, one time run): One time run
Maximum edit rate (e.g. edits per minute): Pywikibot default (6 edits per minute)
Bot flag requested: (Y/N): Yes
Programming language(s): Pywikibot
Ahecht (talk) 03:13, 19 February 2016 (UTC)
Discussion
- Test run looks OK for me. --EugeneZelenko (talk) 15:17, 19 February 2016 (UTC)
- Looks good, could you please link in the edit summary? It's a bit more handy to see "Bot: Replacing {{YMDcat}} with {{Date navbox}}" or "Bot: Removing redundant {{YMDcat}} template" Cheers, Riley Huntley (talk) 20:06, 19 February 2016 (UTC)
- Sounds like a good idea. Will do. --Ahecht (talk) 20:34, 19 February 2016 (UTC)
@Krd: (uninvolved crat) I think this has been open long enough to determine that the requested task can be approved. Riley Huntley (talk) 04:53, 26 February 2016 (UTC)
- @Ahecht: can you make a few more test edits with the improved edit summary? --Krd 06:51, 26 February 2016 (UTC)
- @Krd: I did some more test runs with the new summary, but while doing that I realized that some of the pages had {{YMDcat}} above {{Date navbox}}, so I updated the first regex to not leave a blank line at the top of the page. I ran test edits of both: Special:Contributions/Ahechtbot (the updated regex runs are marked with (v2))
- Looks OK for me. --EugeneZelenko (talk) 15:13, 27 February 2016 (UTC)
- @Krd: I did some more test runs with the new summary, but while doing that I realized that some of the pages had {{YMDcat}} above {{Date navbox}}, so I updated the first regex to not leave a blank line at the top of the page. I ran test edits of both: Special:Contributions/Ahechtbot (the updated regex runs are marked with (v2))
Approved. --Krd 08:23, 29 February 2016 (UTC)