User:Inez/monobook.js

if (document.implementation.createDocument) { var gml_xmlparser = new DOMParser; }

function addlilink(tabs, url, name, id) { var na = document.createElement('a'); na.href = url; na.id = id; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.appendChild(na); tabs.appendChild(li); return li; }

function addRC { if(wgPageName.substring(0,21) == "Special:Recentchanges") { var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlilink(tabs, 'javascript:runRC', 'Display in Realtime', 'td-rc'); }; }

function getFile(filename) { oxmlhttp = null; try { oxmlhttp = new XMLHttpRequest; oxmlhttp.overrideMimeType("text/xml"); }   catch(e) { try { oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }       catch(e) { return null; }     }    if(!oxmlhttp) return null; try { oxmlhttp.open("GET",filename,false); oxmlhttp.send(null); }   catch(e) { return null; }   return oxmlhttp.responseText; }

function runRC { var d = getFile("http://muppet.wikia.com/index.php?title=Special:Recentchanges"); var start = d.indexOf(' '); var end = d.indexOf(''); var txt = d.substring(start,end); var bugstart= txt.indexOf(""); var bugstop = txt.indexOf(""); var fin = txt.substring(0,bugstart) + txt.substring(bugstop);

document.getElementById('bodyContent').innerHTML = txt; var t=setTimeout("runRC",3000); }

addOnloadHook(addRC);