From Wikimedia Commons, the free media repository
Jump to: navigation, search


Operator: Daniel78 (talk)

The tasks would be the exact process that is described here except the bot can not sort the candidates into categories, but would instead need to put new promotions into an unsorted page like the VI and QI bots do. Currently the bot focuses on the featuring process, but there is also a similar delisting process that this bot could work on.

Bot's tasks for which permission is being sought:

This is the same as mentioned above but more condensed:

  • Add voting results to nominations by counting the oppose and support votes
  • Edit the title of the nominations, whether they were featured or not
  • Add the newly promoted pictures to an unsorted page, that will be manually sorted into categories by humans
  • Add the template {{Featured picture}} or {{Assessments|com=1}} to the image description page.
  • Add the picture to the chronological list of featured pictures.
  • Add the template {{FPpromotion|File:XXXXX.jpg}} to the Talk Page of the nominator.
  • Move the nomination from Commons:Featured picture candidates/candidate list to Commons:Featured picture candidates/Log/July 2016.

Automatic or Manually Assisted:

The goal is to make it fully automated but obviously it will be fully manually supervised until it has gone through careful testing. The first implementation will have an interactive flag always set that will require you to manually answer 'Y' before each edit is posted.

Edit type (e.g. Continuous, daily, one time run): Once a day (closing all the nominations that are then more than 9 days old)

Maximum edit rate (eg edits per minute): Can be low, I do not expect many edits in a day

Bot flag requested: (Y/N): Y

Programming Language(s): Python (using pywikipedia)

Daniel78 (talk) 19:42, 7 August 2009 (UTC)


I support he idea of having such a bot. It has been discussed numerous times, but no one has gotten as far with it as you. I have also considered from time to time to implement such a bot, but I realized it that especially the vote counting and closure would be a delicate manner to automate. I therefore appreciate that you intend to get human confirmation for each edit in the beginning. A couple of points/recommendations for you to consider:

  1. There are several different voting templates which mean the same thing, i.e., {{support}}, {{sup}}, {{PRO}}, {{Oui}} and several other templates all mean "support". How do you detect that list of valid templates to look for? Personally I would probably start each run by locating all templates which link to the support, oppose, etc vote icons, and if new ones have been defined since the last run, let the bot operator decide if the new ones should be added to lists of valid vote templates or not.
  2. Does you vote counting procedure ignore anonymous votes?
  3. Does your vote counting procedure check for duplicate votes by the same user?
  4. Does your vote counting procedure ignore votes cast after the voting period?
    • If yes, do they strike them out or mark them as being invalid as part of the closing?
  5. Does your vote counting procedure handle striked out votes?
  6. There may be other delicate special cases which I have not thought of, such as handling the new {{OpposeReasons}} template
  7. To test that you voting procedure works well, I recommend that you grind yourself through all closed FPC noms, let it count the votes off-line and compare it with the official results. In case of deviations you should check manually, if it was the manual vote count which was erroneous or your vote counting procedure.
  8. When you place the Assessments or FeaturedPicture template on the file page, will it then properly add a subpage parameter to the template for file pages, which have a name which differs from the subpage name of the FPC nomination (to make sure the link works)?

--Slaunger (talk) 13:43, 8 August 2009 (UTC)

Thanks for all the pointers. I have thought about several of the issues here but I have so far just spent two evenings on the implementation. The current state is that it handles the english versions of the voting templates for example both {{sup}} and {{support}} including the capitalized versions. It also avoids counting such votes that are striked out and use of {{withdraw}}. Including other versions of the voting templates is not hard, just about adding them to the current regexps, your tip about which templates that includes the icons sounds good, I will look at that.
In it's current state there is no detection of 2,3,4, and thus it relies on humans to have striked such votes out before the nomination is closed. It could be implemented but making a parser that robustly knows which templates that was added by which users might be a bit tricky, you would have to look at the edit log to be sure it was not another user that added a fake signature. But even the manual process is vulnerable to people who really want to tamper with the votes, we can't guard against everything. One option could be to have the bot close the nominations at one time, then wait 24 hours or something before actually moving it away and thus give some time for human inspection of the result and also some time for others to see the result if they are not watching the nomination.
Another issue that is hard for the bot is nominations that includes edited versions, it's hard for the bot to know which edit to look at as it is not certain that it's the latest or the one with most support. The current implementation will just ignore such nomnations and leave it for humans to sort out. The bot could add a message when the time is up for such nominations telling that this needs to be counted manually.
Your point 7 seem to be a very good way of doing a testrun to check the implementation. I will look into that, that could also be used to gather some interesting statistics about previous results.
I have not yet started with the implementation of moving/parking the finished results. But that should be quite simple, it's just about moving the template to the mentioned pages in a certain format, I will focus on the vote counting first. /Daniel78 (talk) 16:34, 8 August 2009 (UTC)

Two more question, which I forgot in first round:

  1. Will the bot be capable of handling the rule of the fifth day?
  2. Will the bot be capable of closing noms, where an {{FPX}} has been cast and has not been followed by a support vote less than 24 h after?

--Slaunger (talk) 13:54, 8 August 2009 (UTC)

Not yet implemented. Rule of the fifth day should be a simple addition. {{FPX}} is a bit trickier as I would have to find out exactly when the template was added, if the users follow the example and sign it including the date it should be ok. /Daniel78 (talk) 16:34, 8 August 2009 (UTC)
  • Could you please make a test run? --EugeneZelenko (talk) 15:03, 8 August 2009 (UTC)
I think a good test would be what Slaunger mentions above, to actually run it against the old results and list all differences. I would need to implement some missing parts before that though. /Daniel78 (talk) 16:34, 8 August 2009 (UTC)
  • Pictogram voting comment.svg Comment I agree with Slaunger on his above points, and make the following suggestions:
    • Use the {{Assessments|com=1}} template, as it means that FP status for other Wikis can be added easily
    • Have the bot notify the creator/uploader, if they are not the same as the nominator. Sarcastic ShockwaveLover (talk) 17:01, 8 August 2009 (UTC)
  • Pictogram voting info.svg Info I have now improved a bit on the count parser and the current results against an old log has been made where I have also explains the reason for the cases where there currently is a difference: TestRun1. This is just a verification test run, thus no edits was made by the bot. /Daniel78 (talk) 12:29, 9 August 2009 (UTC)
    • Pictogram voting comment.svg Comment It is overall a convincing test, which shows that your bot handles vote counting with a reliability, which matches human vote counting. I have posted some detailed comments on the test page. I do not think it is a requirement that you parser can handle all the special cases I mentioned originally - at least not for starters - as long as your bot knows which FPCs it should skip (multiple noms in same subpage, FPX, etc.). I would suggest that the bot summarized its results in a template, like {{FPC-results-ready-for-review}}. This template should automatically associate the FPC subpage to a category, i.e., Category:Featured picture candidates awaiting closure review. A human should then check the closure result, possibly correct mistakes in the vote counts and change the template to, e.g., {{FPC-results-reviewed}}, which places the subpage in a new category, i.e., Category:Featured picture candidates awaiting closure. The bot could then process all subpages in this category, whenever it runs, perhaps changing the template again to a final {{FPC-results}} (which takes it out of the aforementioned category, but renders the result in the same manner) do the archiving, notification on nominators and creators talk pages, and move it to a page for categorization. --Slaunger (talk) 13:57, 9 August 2009 (UTC)
      • Pictogram voting comment.svg Comment I think this makes sense, it lets the bot do the main work but still leaves the control to the users. So in short the bot do a step 1 (count and add the results) and then just wait for confirmation by any user and then do step 2 (move them). I stared with some very simple versions of the templates mentioned here. /Daniel78 (talk) 22:07, 13 August 2009 (UTC)
        • Great that you are implementing my idea and can see its purpose. I looked at the templates. I think they look fine. In the beginning the {{FPC-results-ready-for-review}} could perhaps be written out prepared with a category parameter (although this template does not support it), such that the manual work done by the reviewer changing the template name to {{FPC-results-reviewed}} is minimized. Agree that if the human closure reviewer adds the end category in that single step we do not need the {{FPC-results}} also. A later refinement could be some JS wizardry added for the human closure reviewers convenience, which lets this user select the end category from a drop down box or something like that. --Slaunger (talk) 05:55, 14 August 2009 (UTC)
          • I have now implemented the parking procedure ( that moves reviewed candidates into the specific pages ). I know there are issues to fix, but the main implementation part is now done so I have performed some testing. Yet only of some failed candidates though, I have to wait for some candidates that passes to test that part :). I also mentioned it here. I agree that some JS in the template to make it even easier would be great. /Daniel78 (talk) 18:05, 15 August 2009 (UTC)
  • The bot has now been doing manual runs for a while and I have ironed out a few issues, you can see it's recent changes. Although there are still things to improve I think it handles most common situations by now. I will continue to look after it of course but I think it could be time to let it run as a cron job and as I understand it I need this request accepted before I do that. /Daniel78 (talk) 20:02, 4 September 2009 (UTC)
    • This is looking good to me. This bot is ambitious and if it works, very nifty. How about giving you tentative approval for automation with a view to making that permanent after a few more runs? Would the community see the need to do that? Presumably you are prepared to clean up any messes and enhance the code to avoid them happening again. Else I think just go to approval and call this done. ++Lar: t/c 23:30, 6 September 2009 (UTC)
      • I can set it up for automated runs this weekend, and yes if something goes wrong I will of course fix it :) I also have some improvements on my todo list so I will continue to improve on the code. The code is also public so if I for some strange reason would leave commons, it would be available for anyone else to pick up. /Daniel78 (talk) 20:55, 8 September 2009 (UTC)
  • Please be far more exact about when the bot may do something. I might agree that the bot may do most proposed actions once, after the mentioned picture has indeed been promoted. I probably will not oppose anymore if that "once, after" are made clear. Erik Warmelink (talk) 20:46, 18 September 2009 (UTC)
    • I am not sure exactly what you mean. Do you mean that you want some clearer statements like, "if condition A the bot does B, ... , if condition X the bot does Z" and so on ? /Daniel78 (talk) 00:27, 19 September 2009 (UTC)
      • Sorry, I have little time left. Yes, like that. It already says "the newly promoted image" for one action and I assume other actions are also only done once for that same picture, but that isn't clear. Erik Warmelink (talk) 16:46, 19 September 2009 (UTC)
        • I have added more detailed information at the bots user page User:FPCBot. For even more detailed information the source is also linked from the bot page. /Daniel78 (talk) 20:49, 21 September 2009 (UTC)

Personally I would prefer if the bot would only do the organising bits. A human editor should be the one doing the tallying, instead of the bot. Kanonkas // talk // e-mail // 13:12, 12 October 2009 (UTC)

The bot is doing both, but as can be seen on the bot page there is the human verification step so nothing is closed before that has happened. Thus mostly you can just accept the bot count after checking it. Besides the bot has already been working now for over 2 month with around 2000 edits without any issues raised from the users involved in the FPC process. In essence the bot is already running as if it already had the bot flag except that I check on it daily which I would probably do anyway. So all in all can this bot be accepted ? Of course many improvements can be made, but is not that a separate discussion from this request as long as it does not cause any trouble ? /Daniel78 (talk) 15:03, 12 October 2009 (UTC)
I support the idea of this bot, even with basic functionality it helps with a labourious and error prone task. I think that image nominators watch the progress of their nominations like a hawk and errors (eg in counting due to strange support/decline templates) will be quickly picked up. There are many additions and refinements that can be added as we go, we could delegate discussion of their exact implementation to the FPC talk page if they fall within the general guidelines for operation approved here. My only real concern is support of this code: FP is a long term project, people come and go, the last thing we want is to become dependant on this bot (and its master) and suddenly find that it is unsupported. Can we stipulate that at least two people are familiar enough, and have access to, the code so that it will always be maintained (need some sort of handover to a new person if one of them leaves the project). --Tony Wills (talk) 20:29, 14 October 2009 (UTC)
I will never leave :) Just kidding of course that could happen, but the bots user page already points to the source code in a publicly available git repository that anyone can make a clone of. And hopefully I have documented it well enough both on the bots page and in the source code for someone to pick it up without too much difficulty. But of course if anyone feels like being "co-owner" of the bot code that is perfectly fine with me. /Daniel78 (talk) 20:39, 14 October 2009 (UTC)
The code looks reasonably documented to my unfamiliar eye :-). I have only just scanned through the code, but I am wondering whether it strips out html comments and nowiki blocks and any other comment types, before counting templates. I can think of a couple of ways that extra votes might be seen by the bot, but not apparent to the human eye ;-) --Tony Wills (talk) 11:29, 15 October 2009 (UTC)
I was just considering ways that the striked out template detector might be fooled, but think it is ok. But I just realised that the "ImageNote" block can contain templates (one current nomination contains a support template I seem to recall) which I expect will happily (incorrectly :-) counted. Also I presume you leave it to humans to notice unsigned/anonymous votes. --Tony Wills (talk) 11:49, 15 October 2009 (UTC)
The vote counting implementation is currently very simple, it skips votes that are striked out but do not skip any other votes. Accounting for all uncommon ways of using the templates would probably just make the code more complex than necessary. Nice example with the image note though, I had not though of that :) But as long as we have the manual review step this should not be a big problem. I have no statistics but the rate of counts that are incorrect seem to be very low. I think the next improvement to focus on is how to handle closure of candidates that contain multiple images and not the vote count, because it's the closing that is a lot of manual work, not the counting. But I say it again; to me all these improvement discussions does not feel to belong in this bot flag request, they belong in a place where visible to people involved in the FPC process. /Daniel78 (talk) 21:57, 15 October 2009 (UTC)
The trouble is that people expect computers to be able to count (who checks the adding up of cash-registers?), I waited to see the outcome of the imagenotes example, and sure enough [1] everything looked in order and the ghost vote was included in the count, and confirmed manually - and I don't think any other confirmer would have looked any harder . No effect on the outcome this time, but incorrect never-the-less. Would doing a pre-pass to strip imagenotes, html comments, and nowiki blocks be too difficult? --Tony Wills (talk) 23:22, 17 October 2009 (UTC)
People probably look more carefully when it's a borderline case but still reducing the probability of errors by getting the bot count better would be nice of course. Filtering out the cases you mention would not be too hard, it's basically just doing the same check as for the <s> tag. I will have a look at it soon as I have now also implemented some basic support for handling candidates with several edits as mentioned on the FPC discussion page. Double votes, anonymous votes and late votes are a bit tricker though. But might happen later also, I have never thought about making this perfect from the start, but it's progressively getting better and better. /Daniel78 (talk) 23:47, 17 October 2009 (UTC)
Ok I have now implemented such that the bot filter out the following content before counting votes: The <s> tag, the <nowiki> tag, ImageNotes and HTML comments. Thanks for the suggestions. I used this nomination for verification. If you can think of more tags or templates that needs to be filtered out tell me and I'll add it. /Daniel78 (talk) 00:41, 18 October 2009 (UTC)
Thank you, it is almost perfect ;-). Some ghost voting might have been quite subtle, eg if I had added a comment:
Pictogram voting comment.svg Comment Please use {{support}} or {{oppose}} when voting.
I would have effectively negated one other persons support vote. Yes the confirmation process should have picked it up, but as time goes on people would start to trust the bot to count and easily miss such a mistake. So on behalf of generations of FP nomination to come, thank you :-) --Tony Wills (talk) 01:02, 18 October 2009 (UTC)
  • Hi, Daniel, please take a look at two voting templates in a single vote with a single signature. Could the bot handle it?--Mbz1 (talk) 20:43, 21 October 2009 (UTC)
    • There is not yet any check for such issues. It's up to the reviewer to determine which vote to use if one person has specified several. But in the future the bot could at least get the ability to detect ambiguous votes. /Daniel78 (talk) 21:47, 21 October 2009 (UTC)
      • One strategy to resolve such votes is to simply accept their last vote, but that doesn't resolve entries like that where templates have been used as comments (I would say his vote is Neutral, and he is dithering about whether to make it an Oppose). Strictly it would also mean you would have to look at the timestamps of each vote to see which was posted last. Easiest stategy is to just discount all multiple voting. But with both these strategies you have to make a list of all voters as you go and tally their votes and add lots of complication to handle these exceptions. There are lots of other stuff ups that voters can make, some of which haven't been thought of yet :-). I think it is sensible to just have humans confirm the vote, but give them exact instructions on what to look out for that the bot doesn't/can't handle. --Tony Wills (talk) 23:53, 21 October 2009 (UTC)
        • Yes even though it would be nice if the bot detected such issues it is quite complicated for the bot to handle it, thinking about it; perhaps too complicated. For example to be absolutely sure about which vote that was cast by which person you can't just parse the text for signatures as one can easily add another signature than ones own. Thus to be sure the bot would have to go through each edit/commit to the candidate and keep track of who really added each template (similar to the annotate feature that many version control systems have). And as mentioned even if the bot handled this perfectly and actually detected double votes correctly there are as mentioned no clear solution, one could use the first vote or the last one or discard all of them, so a human preferably have to investigate anyway. A wiki is not really made for voting, imagine how much better this voting procedure could be if we were not locked to parsing a wiki page. /Daniel78 (talk) 21:12, 26 October 2009 (UTC)

  • By the way as already mentioned before, it would be nice to get this request approved. The FPC process is getting quite dependent on it as this "test"-period has been going on for so long now. At least from now on I will not discuss any further improvements/changes to the bot on this page unless it is an absolute requirement for getting the bot flag. Improvements that does not effect the outcome of this bot flag request should be discussed elsewhere. /Daniel78 (talk) 16:07, 27 October 2009 (UTC)

No response for more than 6(!) weeks. It's time to flag this bot. Multichill (talk) 13:06, 16 December 2009 (UTC)

  • Symbol keep vote.svg Agree: From what I've seen, this bot worked just fine. It's making the FP process easier, which is why it's probably good to flag it. --The Evil IP address (talk) 01:59, 17 January 2010 (UTC)

  • ✓ Done to grant to bot flag.--Jusjih (talk) 02:44, 31 January 2010 (UTC)