Extension:InterwikiExistence

The InterwikiExistence extension allows you to have existence detecting interwiki links. Normally, foo will always be a bluelink. This will make it a redlink if that page doesn't exist. This extension polls a remote API to get the data necessary for the integration.

Download InterwikiExistence

 * Download the latest version of InterwikiExistence (once it gets added to Git)
 * Create a folder in the extensions folder named InterwikiExistence
 * Move the files to the extensions/InterwikiExistence/ folder

Install InterwikiExistence

 * Edit LocalSettings.php in the root of your MediaWiki installation, and add the following line near the bottom:

Create and populate tables
To create the necessary tables, you'll need to run update.php. Then go to  and run the maintenance script:. That'll probably take a few hours to finish downloading all the data from Wikipedia's API:AllPages. If you have to abort midway, don't worry, it'll pick up where it left off when you restart it.

Configuration
Change these settings to your liking, making sure that you include them in LocalSettings.php after the require_once line installing the extension.

Known issues
Red-linked interwiki links don't go to the right place; e.g. Adams Chapel will take you to Adams+Chapel. Also, redlinked interwiki links like foo don't display as foo, as they should. If you care to try to figure out what's wrong, you're more than welcome. The problem probably is in InterwikiExistenceHooks::interwikiExistenceLinkEnd.

Also, despite indexing of the iwe_page_title field, insertions to the table still slow populateInterwikiExistencePageTable.php to a crawl. Concurrent database transactions would probably be much faster than these consecutive ones. Have at it, if you want to do it.

There's also some code duplication between InterwikiExistenceHooks::interwikiExistenceUpdate and PopulateInterwikiExistencePageTable::execute. Had the database access been thought out better, a function would have been created that could be used not only for API:Recentchanges and API:Logevents but also API:AllPages. Also, someone who knows what they're doing should probably rewrite InterwikiExistenceHooks::interwikiExistenceLinkEnd.

Changelog

 * 1.0.1: Introduced as highly experimental and with known glitches.

Usage
If you want to bring your tables up to date, visit "Special:InterwikiExistence. Otherwise, the extension will occasionally poll the remote wiki's API for new data when pages are saved.