AfDStatBot
This user is a bot
(talk · contribs)
OperatorStaeiou
AuthorStaeiou
Approved?Yes, RFBA
Flagged?[Yes http://en.wiki.x.io/w/index.php?title=Special%3AListUsers&username=AfDStatBot&group=bot&limit=1]
Task(s)Generates lists of currently open and recently closed AfDs, and lists and notifications for AfDers
Edit rate12 edits/minute max (5 seconds between edits)
Edit period(s)Indefinitely
Automatic or manual?Automatic
Programming language(s)PHP - SxWiki classes
Exclusion compliant?No

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.

Editing

edit

AfDStats

edit

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

edit

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

edit
  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
    1. For new debates:
      1. Get AfD page (current revision)
      2. Get nominated page (revision prior to nomination)
      3. Parse for stats
      4. Post to twitter
    2. For existing debates:
      1. Get AfD page (current revision, only if updated)
      2. Parse for stats
    3. For closed debates:
      1. Get AfD page (current revision)
      2. Parse for stats
      3. Post to twitter
      4. Post message on nominator's page if nominator requested notification
  5. Generate info tables for User:AfDStatBot/AfDStats:
    1. Open AfDs, fields: Article, Nomination date, Number of Participants, Nominator
    2. Recently closed AfDs (last 150), fields: Article, Result, Nomination date, Close Date, Number of Participants, Nominator, Closer
    3. AfD closing stats for recently closed AfDs
    4. AfD closing stats for all AfDs in database
    5. Post only if updated
  6. Generate info tables for users who requested user page updates
    1. Open AfDs user has participated in, fields: Article, User's !Vote, Nomination date, Nominator
    2. Recently closed AfDs user has participated in, fields: Article, Result, User's !Vote, Nomination date, Close date, Number of Participants, Nominator, Closer
    3. User's AfD participation stats
    4. Post to subpage of user page only if updated