Commons:Bots/Requests/FrescoBot 3

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

FrescoBot (talk · contribs)

Operator: Basilicofresco (talk · contributions · Statistics · Recent activity · block log · User rights log · uploads · Global account information)

Bot's tasks for which permission is being sought: fixing common errors in galleries. For example:

  • removing nonexistent parameters like thumb, left, right, upright, size, etc. File:Imagename.jpg|left|Description --> File:Imagename.jpg|Description (example)
  • removing empty and completely redundant gallery tags like <gallery></gallery><gallery>... --> <gallery>... (example)
  • removing lines without any valid image name (like this one this one or this one)
  • removing duplicate images in the same gallery with the same description (like this one or this one)
  • removing images inserted in the gallery with standard markup using square brackets (eg. [1] [2] [3] [4] [5] [6] etc...)

About this last fix: I tried the conversion of the markup instead of removing of the whole line, but I discovered that almost all the images inserted in this way actually do not exist.

01:06, 12 September 2016 (UTC) update:

  • before removing any suspect invalid image the bot will check for the existence of the file
  • if the file does not exist then it will try to fix some common mistakes like a missing/extra | at the end/beginning of the filename [7] [8]
  • it will fix common problems with tags (tags not closed [9] [10], pointless br tags at the end of the line [11], center tags without any content [12], center tags around galleries in packed mode [13], closing tags without the open tag [14], etc.)
  • unexpanded user signatures (3 or more tildes within the galleries) [15]
  • it will blank common dummy captions (eg. Add caption here) [16]
  • multiple pipe characters after the filename [17]
  • unexpanded magic words [18]
  • captions as image parameters [19]

Automatic or manually assisted: automatic unsupervised

Edit type (e.g. Continuous, daily, one time run): montly, every time a new dump is published

Maximum edit rate (e.g. edits per minute): 12 edits/minute

Bot flag requested: (Y/N): N

Programming language(s): python

Basilicofresco (msg) 14:58, 3 September 2016 (UTC)[reply]

Discussion

Looks good for me. --Krd 06:13, 4 September 2016 (UTC)[reply]

Just an update: I managed to detect the existence of the image. So speaking about the last fix I will be able to convert the markup on existing images (example) and remove the lines with an invalid file. -- Basilicofresco (msg) 11:20, 4 September 2016 (UTC)[reply]
I think will be be good idea to use more specific edit summaries. Probably with common prefix like gallery fix/cleanup.
Description should be removed in case with invalid image.
EugeneZelenko (talk) 14:10, 4 September 2016 (UTC)[reply]
IMHO sounds unnecessary a more specific edit summary: the change is going to be pretty obvious. Moreover is always a kind of cleanup: a duplicate entry could be considered cleanup... but also a fix. The same for any other listed fix. Last but not least, I should completely rewrite the script in order to list at the end of the job the exact kind of fixes applied. -- Basilicofresco (msg) 17:57, 4 September 2016 (UTC)[reply]
Please note that I properly remove the descriptions: this is not FrescoBot, it just a source of a problem that later FrescoBot is able to fix. -- Basilicofresco (msg) 18:29, 4 September 2016 (UTC)[reply]
Could you please make test run to avoid confusions? --EugeneZelenko (talk) 14:13, 5 September 2016 (UTC)[reply]

I partially rewritten the script in order to remove some limitations and have a total control over complex nested fixes. I increased as well the range of fixed problems (see above). I run the script again on 50 pages. As you can see now there are also detailed edit summaries. ;) -- Basilicofresco (msg) 01:06, 12 September 2016 (UTC)[reply]

Looks OK, but will be good idea to mention HTML fixes in edit summaries explicitly. --EugeneZelenko (talk) 14:17, 12 September 2016 (UTC)[reply]
At the moment the edit summaries for html tags are gallery unclosed tags and gallery tag fixes. Do gallery unclosed html tags and gallery html tags fixes sound better? -- Basilicofresco (msg) 07:59, 14 September 2016 (UTC)[reply]
Probably unclosed HTML tags in gallery and HTML tags fixes in gallery will be better. --EugeneZelenko (talk) 14:15, 14 September 2016 (UTC)[reply]
Ok, I improved the edit summary. Now will look even better. -- Basilicofresco (msg) 22:49, 14 September 2016 (UTC)[reply]

If there are no objections, I think task should be approved. It will be good idea to share bot code with other bot owners to run on other WMF projects. --EugeneZelenko (talk) 14:10, 15 September 2016 (UTC)[reply]