Wikidata:Requests for permissions/Bot/Pi bot
- The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section. A summary of the conclusions reached follows.
- Approved--Ymblanter (talk) 18:53, 1 March 2018 (UTC)[reply]
Pi bot (talk • contribs • new items • new lexemes • SUL • Block log • User rights log • User rights • xtools)
Operator: Mike Peel (talk • contribs • logs)
Task/s: Fix mismatches between Commons category (P373) and the commons sitelink that are due to one linking to a category redirect.
Code: https://bitbucket.org/mikepeel/wikicode/src/master/commonscat_check.py
Function details: Query for cases where Commons category (P373) is not the same as the commons sitelink (but both are present). If one of them points to a commons category that has commons:Template:Category redirect in it, and that redirect points to a category with the same name as the other value on Wikidata, then update the value to avoid the redirect. Run daily to catch new cases caused by category moves on Commons. Example edits: [1] [2] (for the two different cases). --Mike Peel (talk) 14:36, 22 February 2018 (UTC)[reply]
- Looks good, pls run 50 test edits.--Ymblanter (talk) 08:37, 25 February 2018 (UTC)[reply]
- @Ymblanter: Done, see [3]. The test run showed up a few issues, so I've modified the code to cope with them. If there are multiple P373 values present, then the code skips that entry. If one of the two commons links leads to a missing page, then it counts them and doesn't make an edit at the moment (although I've drafted some code that will also handle this case, which I'll enable once I find some test cases). And if Wikidata reports an interwiki conflict, then the code logs that and moves on (I don't know if there's a better way to check for this in pywikibot?). Thanks. Mike Peel (talk) 13:36, 25 February 2018 (UTC)[reply]
- Thanks. I will approve the bot in a couple of days provided there have been no objections raised.--Ymblanter (talk) 14:26, 25 February 2018 (UTC)[reply]
- @Ymblanter: Done, see [3]. The test run showed up a few issues, so I've modified the code to cope with them. If there are multiple P373 values present, then the code skips that entry. If one of the two commons links leads to a missing page, then it counts them and doesn't make an edit at the moment (although I've drafted some code that will also handle this case, which I'll enable once I find some test cases). And if Wikidata reports an interwiki conflict, then the code logs that and moves on (I don't know if there's a better way to check for this in pywikibot?). Thanks. Mike Peel (talk) 13:36, 25 February 2018 (UTC)[reply]