User:AfDStatBot

This bot posts new and closed AfDs on Twitter and maintains a list of currently active and recently-closed AfDs at User:AfDStatBot/AfDStats, as well as some statistics. It also informs AfD participants in two ways: first, leaving a talk page message for nominators when their AfD is closed, and second, generating an up-to-date list of all the open and recently closed AfDs a user has participated in. These features are by request/opt-in only.

AfDStats
The bot runs once every thirty minutes and updates one page if necessary: User:AfDStatBot/AfDStats. Because the tables include the number of participants in each open AfD, these pages are almost always updated each time it runs.

User Notifications and Lists
The bot would also make as many as two edits every thirty minutes for as many as users request updates to be sent to their user talk page and/or at a user subpage. The request list is at User:AfDStatBot/Requests. These are made at a max rate of one every five seconds.

It only needs to update the user's subpage after a user participates in an AfD for the first time or if an AfD s/he has participated in has closed. Nominator talk page notifications are less frequent because only one of them is made for each closed AfD.

For the ten most active AfDers, a simulation run over 48 hours indicates that 234 updates would be made to the subpages of these users. On average, that is about one edit ever 30 minutes for each highly-active AfDer who signs up. Note that this was done when the update interval was every 10 minutes, and this rate will go down now that it is changed to every 30 minutes.

Algorithm

 * 1) Login
 * 2) Get list of users who requested notification at User:AfDStatBot/Requests
 * 3) Get list of current AfD debates via Category:AfD_debates
 * 4) Compare list of current debates to stored list
 * 5) For new debates:
 * 6) Get AfD page (current revision)
 * 7) Get nominated page (revision prior to nomination)
 * 8) Parse for stats
 * 9) Post to twitter
 * 10) For existing debates:
 * 11) Get AfD page (current revision, only if updated)
 * 12) Parse for stats
 * 13) For closed debates:
 * 14) Get AfD page (current revision)
 * 15) Parse for stats
 * 16) Post to twitter
 * 17) Post message on nominator's page if nominator requested notification
 * 18) Generate info tables for User:AfDStatBot/AfDStats:
 * 19) Open AfDs, fields: Article, Nomination date, Number of Participants, Nominator
 * 20) Recently closed AfDs (last 150), fields: Article, Result, Nomination date, Close Date, Number of Participants, Nominator, Closer
 * 21) AfD closing stats for recently closed AfDs
 * 22) AfD closing stats for all AfDs in database
 * 23) Post only if updated
 * 24) Generate info tables for users who requested user page updates
 * 25) Open AfDs user has participated in, fields: Article, User's !Vote, Nomination date, Nominator
 * 26) Recently closed AfDs user has participated in, fields: Article, Result, User's !Vote, Nomination date, Close date, Number of Participants, Nominator, Closer
 * 27) User's AfD participation stats
 * 28) Post to subpage of user page only if updated