Jump to content

User:Gdr/DYKbot

From Wikipedia, the free encyclopedia

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

[edit]
  1. Edit Template talk:Did you know, formatting suggestions in the form ...that <text> '''[[<article>]]''' <fact>? ([[:Image:<image>]]) [[User:<suggester>]] <other text>. The <image>, <suggester>, and <other text> 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

[edit]

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 {{mprotected}}.
  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 {{subst:User:Gdr/Did you know header|[[Image:New image|100px|]]}} for the top of the page, formatting each suggestion with <li>...</li>, and using {{subst:User:Gdr/Did you know footer}} for the bottom of the page.
  9. Purge the Main Page cache by visiting [1].
  10. Unprotect the old image.
  11. Edit the description page for the old image, removing {{mprotected}}.
  12. Edit the talk page of each user who created a suggestion, adding the message {{UpdatedDYK|[[<article>]]}}.
  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 *...<br>, 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)

[edit]
  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#Proposed change to process).

Source code

[edit]

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