User:Gdr/DYKbot

DYKbot is a Wikipedia bot that partially automates the procedure of placing new items on Template:Did you know on the English Wikipedia. It uses the Python Wikipedia Robot Framework.

DYKbot is currently in development. It is operated from time to time by User:Gdr.

Operator instructions

 * 1) Edit Template talk:Did you know, formatting suggestions in the form  ...that   ? (Image: ) User:  . The &lt;image&gt;, &lt;suggester&gt;, and &lt;other text&gt; are optional. Check that the suggestions are good quality articles suitable for being referenced from the Main Page.
 * 2) Run python login.py and log in as your administrator account.
 * 3) Run python dykbot.py --for-real  Answer the questions.  (If you omit --for-real it won't actually update Wikipedia. It's worth running through without --for-real to get a feel for what the bot does.)

What it does
DYKbot only runs attended. Each operation is presented as a diff and requires confirmation from the operator.


 * 1) Check that it's more than 6 hours since the last time Template:Did you know was edited.
 * 2) Read Template talk:Did you know and find suggestions. (It relies on the header "Inform these users" as the point at which to stop looking for suggestions.). Ask for each suggestion whether you want to use it. Make sure that you pick at least one suggestion with an image.
 * 3) Check that each of the suggestions was created in the last 72 hours.
 * 4) Check that the new image has a plausible license (by looking for a template starting GFDL, PD, or CC).
 * 5) Edit the description page for the new image, adding.
 * 6) Protect the new image.
 * 7) Read Template:Did you know to find the old image (if any).
 * 8) Edit Template:Did you know, replacing the whole contents using  [[Image:New image|100px|]]  for the top of the page, formatting each suggestion with  ... , and using <tt>  </tt> for the bottom of the page.
 * 9) Purge the Main Page cache by visiting.
 * 10) Unprotect the old image.
 * 11) Edit the description page for the old image, removing.
 * 12) Edit the talk page of each user who created a suggestion, adding the message <tt>  </tt>.
 * 13) Edit Template talk:Did you know as follows: (a) set the "next refresh" time to be 6 hours from now; (b) delete the suggestions that were picked by the user from the "Suggestions" section; (c) add these new suggestions to the top of the "Archive" section, formatted with <tt> *...  </tt>, for User:AllyUnion's bot to archive. (It relies on text in a comment to find the right place to archive the suggestions.)

What it doesn't do (yet)

 * 1) Notice when an image is actually from the commons, or take appropriate action in this case.
 * 2) Put a caption on the image.
 * 3) Archive suggestions after they've been on DYK (see Wikipedia talk:Did you know).

Source code
Still under development, but see User:Gdr/dykbot.py (it uses the module User:Gdr/protect.py and User:Gdr/history.py).