User:Gdr/DYKbot
From Wikipedia, the free encyclopedia
< User:Gdr
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.
Contents |
[edit] Operator instructions
- 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.
- Run python login.py and log in as your administrator account.
- 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.)
[edit] What it does
DYKbot only runs attended. Each operation is presented as a diff and requires confirmation from the operator.
- Check that it's more than 6 hours since the last time Template:Did you know was edited.
- 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.
- Check that each of the suggestions was created in the last 72 hours.
- Check that the new image has a plausible license (by looking for a template starting GFDL, PD, or CC).
- Edit the description page for the new image, adding {{mprotected}}.
- Protect the new image.
- Read Template:Did you know to find the old image (if any).
- 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.
- Purge the Main Page cache by visiting [1].
- Unprotect the old image.
- Edit the description page for the old image, removing {{mprotected}}.
- Edit the talk page of each user who created a suggestion, adding the message {{UpdatedDYK|[[<article>]]}}.
- 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.)
[edit] What it doesn't do (yet)
- Notice when an image is actually from the commons, or take appropriate action in this case.
- Put a caption on the image.
- Archive suggestions after they've been on DYK (see Wikipedia talk:Did you know#Proposed change to process).
[edit] Source code
Still under development, but see User:Gdr/dykbot.py (it uses the module User:Gdr/protect.py and User:Gdr/history.py).