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.

At the moment, the extension is throwing "Notice: Undefined index" errors; the developer is working to resolve this issue.

TODOs:
 * Enable it to import enwiki-latest-all-titles. Only use AllPages if a config setting is switched on. (Unnecessary server load)
 * Enable PopulateInterwikiExistencePageTable to handle other namespaces besides the main one.
 * Enable handling of page restorations (leaction=delete/restore).
 * Implement some sort of algorithm (I thought it might be a divide and conquer algorithm, but now I'm not so sure) that lets the extension figure out where to pick up with the API polls. E.g., suppose you do an enwiki-latest-all-titles import, and don't know the timestamp of when the page listwas exported to that file. Select a date that is the earliest you think it could possibly have been exported, e.g. four months ago. InterwikiExistence should then, using API polls, be able to figure out when the export was done. Hmm, how exactly, though, to get to a high enough degree of certainty without doing a bunch of wasteful API pulls?

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.

InterwikiExistence.i18n.php
.',       'interwikiexistence-continuing' => 'Progress was made in updating the $1 part of the interwiki existence table, but more API polls are needed to bring it completely up to date.', 'interwikiexistence-creation' => 'creation', 'interwikiexistence-deletion' => 'deletion' );

/** Message documentation * @author Leucosticte */ $messages['qqq'] = array(	'interwikiexistence-desc' => '',	'interwikiexistence-trigger-success' => 'This is the message the user gets after he triggers a successful interwiki existence table update.',       'interwikiexistence-trigger-throttled' => "This is the message the user gets when he tries to update the interwiki table too soon after the last triggering.",	'interwikiexistence-trigger-noretrieve' => 'This is the message the user gets if an error retrieving data from the remote wiki prevents the interwiki existence table from being updated. The parameter is the URL of the remote wiki.',        'interwikiexistence-trigger-nodecode' => 'This is the message the user gets if an error decoding data from the remote wiki prevents the interwiki table from being updated. The parameter is the URL of the remote wiki.',        'interwikiexistence-notallowed' => 'This is the message the user gets when he tries to trigger interwiki table updates from an account without the interwiki right.', 'interwikiexistence-notimestamp' => 'This is the message that is displayed when no interwiki existence timestamp is found.', 'interwikiexistence-continuing' => 'This is the message displayed with progress was made in updating the $1 part of the interwiki existence table, but more API polls are needed to bring it completely up to date.', 'interwikiexistence-creation' => 'This is the name of the creation timestamp.', 'interwikiexistence-deletion' => 'This is the name of the deletion timestamp.' );

/** German (Deutsch) * @author Kghbln */ $messages['de'] = array(	'interwikiexistence' => 'Aktualisierung der Interwikilinktabelle starten',	'interwikiexistence-desc' => 'Aktualisiert die lokale Interwikitabelle mit dem Inhalt einer Interwikiübersicht eines anderen Wikis',	'interwikiexistence-trigger-success' => "Der Teil $1 der Interwikilinktabelle ist nun aktuell.",       'interwikiexistence-trigger-throttled' => 'Du bist nicht berechtigt die Aktualisierung des Teils $2 der Interwikilinktabelle zu starten, da während der vergangenen NaN Sekundens bereits eine Aktualisierung begonnen wurde.',	'interwikiexistence-trigger-noretrieve' => "Ein Fehler beim Abrufen der Daten von einem fremden Wiki hat die Aktualisierung der Interwikilinktabelle verhindert. Die URL des Wikis lautet: „$1“,        'interwikiexistence-trigger-nodecode' => "Ein Fehler beim Dekodieren der Daten von einem fremden Wiki hat die Aktualisierung der Interwikilinktabelle verhindert. Die URL des Wikis lautet: „$1“, 'interwikiexistence-notallowed' => 'Du bist nicht berechtigt die Aktualisierung der Interwikilinktabelle zu starten.', 'interwikiexistence-notimestamp' => 'In der Interwikilinktabelle konnte zu Teil $1 kein Zeitstempel ermittelt werden. Wohlmöglich muss das Skript  noch ausgeführt werden.', 'interwikiexistence-continuing' => 'Teil $1 der Interwikilinktabelle wurde teilweise aktualisiert. Indes muss die API weitere Datenabrufe vornehmen, um die Aktualisierung abschließen zu können.', 'interwikiexistence-creation' => 'erstellt', 'interwikiexistence-deletion' => 'gelöscht' );

/** German (formal address) (Deutsch (Sie-Form)‎) * @author Kghbln */ $messages['de-formal'] = array(       'interwikiexistence-trigger-throttled' => 'Sie sind nicht berechtigt die Aktualisierung des Teils $2 der Interwikilinktabelle zu starten, da während der vergangenen NaN Sekundens bereits eine Aktualisierung begonnen wurde.',        'interwikiexistence-notallowed' => 'Sie sind nicht berechtigt die Aktualisierung der Interwikilinktabelle zu starten.', );