Last modified: 2013-11-25 17:45:35 UTC
It's rather time-consuming, when one is creating articles on one's local wiki, to add all the redirects for the names that people might use in their attempts to look up various topics. Wikipedia has already done this work in many cases, and there is often no need to reinvent the wheel. E.g. suppose I am creating a Mises Wiki article on John Maynard Keynes. People might very well search for the Mises Wiki article on him using the same names (e.g. "John Keynes", "Lord Keynes", etc.) that, on Wikipedia, are redirects to John Maynard Keynes; so Mises Wiki may as well have the very same redirects. The presence of these redirects will also make it less likely people will inadvertently create two articles on the same topic, and it will also encourage them to pick the name for the topic that has been chosen on Wikipedia as being the best name. Therefore, I propose a new extension to do the following. When a user clicks on a redlink, it will still prompt him to create a new page but also note, e.g., if he clicked on a link leading to a non-existent John Keynes article, "On Wikipedia, John Keynes redirects to John Maynard Keynes. Click here to instead create a new article entitled John Maynard Keynes (a redirect will automatically be created from John Keynes)." If the John Maynard Keynes article already exists, then if the user clicks on a redlink to John Keynes, it should note, "On Wikipedia, John Keynes redirects to John Maynard Keynes. This wiki has an article entitled John Maynard Keynes. Click here to create a redirect on this wiki from John Keynes to John Maynard Keynes." Also, if a user creates a new article entitled John Maynard Keynes, the extension should present him with a checklist similar to the list of redirects you see at https://toolserver.org/~dispenser/cgi-bin/rdcheck.py?page=John_Maynard_Keynes and ask if he wants to create all those redirects leading to it on the local wiki. There are a few ways the extension could do this. The simplest option is to poll Wikipedia's API at the time someone clicks on a mainspace redlink. However, that causes the polling to increase proportionately to editing activity, so it's not scalable, as it would violate live mirrors policy. If one doesn't mind waiting until dumps are released to get a new redirects list, the extension (or a bot that accesses an API module that the extension adds) could check the RSS feed for that file and import the data when it becomes available. Alternatively, the extension (or a bot) could periodically poll the Wikipedia API (much as, say, Extension:InterwikiMap polls Meta-Wiki to get the interwiki table), using apfilterredir=redirects. I'm not sure that there's any easy way to get an incremental update since existing pages could become redirects at any time and existing redirects could be changed into non-redirect pages at any time. So I guess it's necessary to get a complete list whenever one wants to update one's local table of Wikipedia redirects.
I guess rcprop=redirect could be a good way to get incremental updates, if the wiki contained a complete list of pages that exist on Wikipedia. https://www.mediawiki.org/wiki/API:Recentchanges Extension:InterwikiExistence maintains such a list anyway, so this could work with that extension or even be part of it. iwe_page would need to have an iwe_page_is_redirect field added to it, and/or iwe_page_made_redirect and iwe_page_made_not_redirect fields to hold timestamps. https://www.mediawiki.org/wiki/Extension:InterwikiExistence/iwe_page_table