User:Stratoprutser/404.js

/** * User-script in utter disregard of Wikimedia privacy policy * use at your own risk to display interlanguage-links on 404-pages and redlinks * See Beer_parlour/2013/February */

jQuery;

var microbubble = window.microbubble || {}; jQuery.fn.getPipe = function { var pipeFeed = new microbubble.PipeFeed(this); pipeFeed.parse; };

/** * PipeFeed Class * Returns interwikis */ microbubble.PipeFeed = function (htmlElement) { htmlElement.html(''); var listElement = $("#feed-results");

return { parse: function (word) { $.getJSON("http://pipes.yahoo.com/pipes/pipe.run?_id=7ac42099ecdbca4d74462199a5383c89&_render=json&_callback=?&word=" + wgTitle,

function (json) { parseFeed(json); });		}	};

function parseFeed(json) { var seen = {}; /* preventing double interwikis */ if (json.count > 0) { $(json.value.items).each(function {                var itemDetail = createInterwiki(this);                if (seen[itemDetail]) $(this).remove;                else {                    seen[itemDetail] = true;                    $(listElement).append(itemDetail);                }            }); } else { -htmlElement.html(' No interwikis found\n'); }   }

function createInterwiki(item) {               return '' + item.content + '\n'; }

};

if (wgArticleId==0 && wgCanonicalSpecialPageName==false) {       $('#mw-panel').append(' \n In other languages \n  '); $("#interwikis").html(" loading interwikis... "); $("#interwikis").getPipe; }