Last modified: 2013-10-05 04:44:30 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/bugs/1411/ Reported by: mga73 Created on: 2012-02-26 11:29:51 Subject: Update commonscat.py for en-wiki Original description: As a part of http://en.wikipedia.org/wiki/Wikipedia:Bots/Requests\_for\_approval/MGA73bot\_4 there has been a clean up in the number of templates used on enwiki. The main template "Commons category" has 2 redirects http://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=Template:Commons\_category Alternative templates \* Commons - no longer has redirects http://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=Template:Commons \* Commons and category + 1 redirect http://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=Template:Commons\_and\_category \* Commons-inline + 3 redirects http://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=Template:Commons-inline \* Commons category-inline + 7 redirects http://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=Template:Commons\_category-inline \* Commons category multi + 9 redirects Templates where "Commons" or "Commons category" is build in: \* Commonscatmore \* Airports by country category description \* BC year in topic \* C11 year in topic \* C12 year in topic \* C13 year in topic \* C14 year in topic \* C15 year in topic \* C16 year in topic \* C17 year in topic \* C18 year in topic \* C19 year in topic \* C20 year in topic \* C21 year in topic \* Cathead Conservatism in \* Cathead passenger ships of the \* Howtoreqphoto \* M1 year in topic \* Motorsport decade category There may be more http://en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Template:Commons&namespace=10&limit=250 \(some are just shown via the /doc. Any way to find out easy? We should probably hunt down and kill redirects and try to avoid that the template is build into other templates.
I started to find and kill redirects.
See http://en.wikipedia.org/wiki/Wikipedia:Redirects\_for\_discussion/Log/2012\_February\_26\#Template:Common\_cats for cleanup. Perhaps we should wait for the redirects to be deleted. However, if anyone has ideas they are most welcome.
As I said at one of the deletion requests \(http://en.wikipedia.org/wiki/Wikipedia:Redirects\_for\_discussion/Log/2012\_February\_26\), there is a simple general solution for this, the Backlinks API \(http://www.mediawiki.org/wiki/API:Backlinks\). Basically, when the bot starts up, it should do backlink redirect queries \(blfilterredir=redirects\) for any templates it's interested in. Then, it treats the whole set \(including just discovered redirects\) exactly the same as the original one. I will look at implementing this. However, I'm not familiar with the Python Wikipedia Robot Framework, so someone else may beat me to it. :\)