User:GreenC bot/Job 20

peerr removes the template from talk pages when no longer needed. ie. the template was added more than 7 days ago indicating the peer review processes has stalled or was not properly initiated.

Long description: As part of the peer review process, are added to article talk pages, but sometimes the process is not done correctly or stalls. A tracking cat was created to catch these (Category:Peer review requests not opened), but still requires manual removal of the template after waiting some time. It is safe to say if the template has been in place for more than 7 days without indication the rest of the processes has been done, the template can be removed. To automate: once a day, the bot retrieves the list of page names in the tracking category, along with today's date ("added date"), and adds it to a text file. If the page name is already in the text file don't add it again, rather check if it has been more than 7 days since the added date. If so, verify there is a corresponding peer review page called Peer review/PAGENAME/archiveX and if not then remove the Peer review template, and remove the text file entry. Likewise if the page name is in the text file but not in the tracking category then remove the page name from the file.

The idea for a bot was originally conceived by Tom (LT).

FAQ

 * Where was the bot discussed?
 * BRFA
 * User_talk:GreenC (initial discussion)


 * What if the bot made a mistake?
 * Report errors to User_talk:GreenC bot


 * How do I keep it off a page?
 * Add somewhere in the page ie.


 * How can I track the bot?


 * Logs and data are available at https://tools-static.wmflabs.org/botwikiawk/peerr/
 * loguploads.txt - 1-line per removal. It shows the command the bot invoked to edit the page
 * logerrors.txt - any errors on upload
 * list.txt - A CSV with "" as separator. Field 1 is the talk page where the template is located. Field 2 is the date the bot first became aware of the template. Field 3 is the page being monitored for creation within 7 days of field 2.