Wikipedia:Bots/Requests for approval/DieBucheBot

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by DieBuche (talk | contribs) at 15:55, 22 March 2007 (→‎Discussion). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Operator: User:DieBuche

Automatic or Manually Assisted: Automatic, but supervised

Programming Language(s): pywikipedia framework

Function Summary: Do some replacements especially superseded pictures from commons

Edit period(s) (e.g. Continuous, daily, one time run): 3-4 times a week

Edit rate requested: 4-5 edits per minute

Already has a bot flag (Y/N): No

Function Details: This Bot replaces pictures on commons that have been marked as "superseded" [1] with the new picture.

Discussion

  • Will this bot work on commons, on en-wiki, or on both? Is the idea here that you type in the name of a superseded image, and the name of the better image, and all pages using the old image on en-wiki will be updated to link to the other image? Gimmetrow 00:41, 20 March 2007 (UTC)[reply]
It works only on en-wiki, i tell him which images have to be replaced, he doesn't find them automatically --DieBuche 13:23, 20 March 2007 (UTC)[reply]
How do you get the pages on which to replace it? All pages or only those in article namespace? If you're using python regexp to replace the image links, how do you plan to deal with varations in use of underscores and spaces? (There are a couple ways to handle this.) Gimmetrow 19:17, 21 March 2007 (UTC)[reply]
I didn't think about this. Can you tell me how to do it ? --DieBuche 19:58, 21 March 2007 (UTC)[reply]
Well, the simple solution is to convert all underscores to spaces, then search for the image name with spaces. This is convenient (doesn't even need a regexp) but will change every underscore on the page. I'm pretty sure some tools do this, and it's usually OK. Or you could make a bit more complex regexp to only convert underscores between sets of double brackets. Gimmetrow 22:45, 21 March 2007 (UTC)[reply]
This is overall a good idea, but there is no reason to change the entire page at all. Perhaps this is what you meant, but let me explain. It is a matter of retrieving the page, converting a local copy from underscores -> spaces and upper case -> lower case, find the strings that match in the page and remember their indicies. Next, perform the replacement on a different copy that has not had the conversions applied. Then submit the latter copy when finished doing the find and replace. The alternative is to do this with a complex regexp, just depends on personal preference. -- RM 12:19, 22 March 2007 (UTC)[reply]
"Remember their indices" is a little tricky if it's using regexp or replace. There are some tool(s) which leave the underscore->space replacement in the article. Gimmetrow 13:02, 22 March 2007 (UTC)[reply]
Oh, I understand that. That's why I said regexp is a separate solution (and probably the best one) from the one I described. Doing article processing would require custom code to perform the scanning, finding, and replacing. My overall point is that the tools may not be good enough, since doing a global underscore->space replacement is a bad idea, as it could remove legitimate underscores. That just makes this a little more difficult to pull off correctly. But I won't approve a bot that has a known risk of adding errors, so the work has to be done to make it work correctly. -- RM 13:25, 22 March 2007 (UTC)[reply]
I thought it could been done without regexp; But now I know that I've to. --DieBuche 15:55, 22 March 2007 (UTC)[reply]