Wikipedia:Bots/Requests for approval/MonoBot 3
Tools
Actions
General
Print/export
In other projects
Appearance
From Wikipedia, the free encyclopedia
- The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Approved.
Operator: Mønobi
Automatic or Manually Assisted: auto
Programming Language(s): python
Function Summary: update {{NowCommons}}
Edit period(s) (e.g. Continuous, daily, one time run): cont
Edit rate requested: 15 edits per minute
Already has a bot flag (Y/N): Y
Function Details: Sometimes when a user adds {{nowcommons}} and they rename the image they don't update the links on the articles and it gets moved to commons and deleted and a redlink is left. This bot would search through all pages using {{nowcommons}} and would update the link if the image is named differently on commons than en.wiki. For example image "a.jpg" is renamed to "b.jpg" when moved to commons. The bot would replace a.jpg in the articles it is used with b.jpg.
Discussion
[edit]- What if a user vandalised {{nowcommons}} onto the page or if it was a fair use image? Would the bot still delete? jon (blab) 01:29, 29 February 2008 (UTC)[reply]
- It doesn't delete anything, it just updates the links and it checks to make sure the image is on commons (although the image should be on commons if the template is being used). Mønobi 01:32, 29 February 2008 (UTC)[reply]
- In that case, you may want to refine that in the description. Thanks! jon (blab) 01:33, 29 February 2008 (UTC)[reply]
- Awesome! exactly what I need for my bot! CWii(Talk|Contribs) 01:37, 29 February 2008 (UTC)[reply]
- Could you do anything to verify the image on commons is the same image? At the risk of BEANS, what checks could you have to prevent the bot from being used to vandalize articles? Gimmetrow 04:13, 29 February 2008 (UTC)[reply]
- I suggest calculating the hash for both the local and commons image. As you're using python, I assume you're using pywikipedia. In that case you can use imagepage's method getFileMd5Sum(). --Erwin85 (talk) 10:58, 29 February 2008 (UTC)[reply]
- See [1], [2]. This is what it's suppose to do. This is where it tripped up: [3] because of this. I will add the hash check. Mønobi 17:11, 1 March 2008 (UTC)[reply]
- Looks good. Approved for trial (60 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Let's see how it works. Soxred93 | talk bot 17:17, 1 March 2008 (UTC)[reply]
- See latest contribs, no problems. Hash check added. Only makes changes in the mainspace. Mønobi 20:03, 1 March 2008 (UTC)[reply]
- Looks good. Approved for trial (60 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Let's see how it works. Soxred93 | talk bot 17:17, 1 March 2008 (UTC)[reply]
- See [1], [2]. This is what it's suppose to do. This is where it tripped up: [3] because of this. I will add the hash check. Mønobi 17:11, 1 March 2008 (UTC)[reply]
- I suggest calculating the hash for both the local and commons image. As you're using python, I assume you're using pywikipedia. In that case you can use imagepage's method getFileMd5Sum(). --Erwin85 (talk) 10:58, 29 February 2008 (UTC)[reply]
- (outindent) Trial run did, in fact, show problems. The bot is making needless changes as it's not recognizing spaces and underscores as being the same thing in a file name. It should also only use spaces when it does actually need to make an it. More details can be found at bot's talk page and at ANI. -- JLaTondre (talk) 21:23, 1 March 2008 (UTC)[reply]
- That's hardly a problem, and it's been fixed. Mønobi 21:24, 1 March 2008 (UTC)[reply]
- Let's try 35 more edits, and see if it still has problems. Approved for trial (35 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Soxred93 | talk bot 21:25, 1 March 2008 (UTC)[reply]
- (e/c)It's most certainly a problem. Enough of one to get the bot blocked. Needless edits are a waste of server resources. Using underscores is contrary to our linking recommendations. Fixing it is great. -- JLaTondre (talk) 21:28, 1 March 2008 (UTC)[reply]
- Easy enough to handle in the regexes, although simply changing underscores to spaces alone is a waste of resources. And there doesn't seem to be a good reason to block a bot which is under trial and doing a fixed number of edits. Gimmetrow 21:52, 1 March 2008 (UTC)[reply]
- I did not recommend the bot be used for simply changing underscores to spaces alone nor do I think that's what the user is intending to do. My comment was that when the bot does need to change an image name, it always insert the space version.
As for the blocking, you would have to discuss that with the blocking admin. However, I'd guess that most folks who don't watch the bot pages are not familiar with the approval process. They simply saw a bot making troublesome changes & reacted to that. They did not realize that it was only a limited run.
Thanks. -- JLaTondre (talk) 22:21, 1 March 2008 (UTC)[reply]- When you get the filename, do something like below, which replaces all underscores in the name with spaces, and makes a regex that matches any variation. If the filename can have any special characters like (, you'll have to check for those and escape them too. Gimmetrow 23:03, 1 March 2008 (UTC)[reply]
- I did not recommend the bot be used for simply changing underscores to spaces alone nor do I think that's what the user is intending to do. My comment was that when the bot does need to change an image name, it always insert the space version.
- Easy enough to handle in the regexes, although simply changing underscores to spaces alone is a waste of resources. And there doesn't seem to be a good reason to block a bot which is under trial and doing a fixed number of edits. Gimmetrow 21:52, 1 March 2008 (UTC)[reply]
- That's hardly a problem, and it's been fixed. Mønobi 21:24, 1 March 2008 (UTC)[reply]
filename = filename.replace('_', ' '). regexp = filename.replace(' ', '[ _]')
- monobi why not use the built in pywikipedia image replacement function? also may I review the source code? βcommand 23:13, 1 March 2008 (UTC)[reply]
- Beta, source code is linked from the bot's user page. Gimmetrow 23:26, 1 March 2008 (UTC)[reply]
- Done. Mønobi 21:04, 5 March 2008 (UTC)[reply]
- Beta, source code is linked from the bot's user page. Gimmetrow 23:26, 1 March 2008 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section.