Commons:Bots/Requests/Gabrielchihonglee-Bot (4)

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

Gabrielchihonglee-Bot (talk · contribs) (4)

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

Bot's tasks for which permission is being sought: Remove redundant interlanguage links from category pages that are already linked by {{Interwiki from Wikidata}}. Eg.: It would remove [[nl:Postzegel]] (nl:Postzegel) from Category:Stamps because its a duplication.

This task is similar in both functionality and logic to Commons:Bots/Requests/YiFeiBot_(22); requested at User_talk:Zhuyifei1999/Archive_33#Complex_Interwiki.

The bot:

  • scans a complete dump of Commons
  • filters out Category pages with at least one interlanguage link at the time of the dump
  • check to see if the current revision transcludes (both directly and indirectly) {{Interwiki from Wikidata}} by using MediaWiki API.
  • searches for a direct {{Interwiki from Wikidata}} call in the current page wikitext using mwparserfromhell, and expand that with expandtemplates MediaWiki API call. If not found, expand {{Interwiki from Wikidata}} without parameters instead as it is very unlikely (as of now) that any indirect use supplies a custom Wikidata item ID.
  • search for and remove duplicated interlanguage links in current page wikitext and in the expanded template. Duplication does not require the link wikitext to be exactly equal, but the page it points to must be the same.

Similar to YiFeiBot (22), this bot will not edit Wikidata; any interlanguage removed are "redundant" that another user or bot added to wikidata.

Automatic or manually assisted: Automatic unsupervised

Edit type (e.g. Continuous, daily, one time run): Weekly

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

Bot flag requested: (Y/N): N

Programming language(s): Python: pywikibot & mwparserfromhell

Script: [1]

Gabrielchihonglee (talk) 02:51, 31 March 2018 (UTC)[reply]

Zhuyifei1999 (talk) 02:55, 31 March 2018 (UTC)[reply]

Discussion

  • I would like to see this clean-up as part of {{Wikidata Infobox}} deployment. --EugeneZelenko (talk) 14:00, 31 March 2018 (UTC)[reply]
    • Both bot codes are Python/pywikibot, so in principle this would be relatively straightforward to do. However, I think it's better to keep the tasks separate, so that a revert of a Wikidata infobox addition doesn't also revert trimming the interwiki links, and vice versa. Although I don't think either is likely in large quantities, it keeps things cleaner if they are separate. Thanks. Mike Peel (talk) 23:35, 31 March 2018 (UTC)[reply]

Can anybody please summarize if there are unaddressed issues/concerns? @Zhuyifei1999: ? --Krd 06:44, 7 April 2018 (UTC)[reply]

Can someone else summarize? I wrote parts of the script and as a semi-bot-operator I think I addressed whatever that needs to be addressed. --Zhuyifei1999 (talk) 15:38, 7 April 2018 (UTC)[reply]
Most of the above arguments were about expanding the code or merging bot tasks. In terms of the original task requested, everything looks OK, and it's a useful task to do. Adding support for {{VN}} might be useful, but not doing so doesn't harm this task, and it's something that could be added later / be the subject of another bot request. Merging bot tasks together might be good, but adds complexity to the code and to the edits, so it's simpler to keep them separate, and there's negligible downside. So I'd suggest that the points here are suitably resolved and this should be ready to go. Thanks. Mike Peel (talk) 15:38, 11 April 2018 (UTC)[reply]

Approved. --Krd 06:15, 13 April 2018 (UTC)[reply]