Skip to content

Instantly share code, notes, and snippets.

@fuba
Created November 22, 2011 04:50
Show Gist options
  • Save fuba/1384920 to your computer and use it in GitHub Desktop.
Save fuba/1384920 to your computer and use it in GitHub Desktop.
dotjs script: replace Jimmy Wales to relevant image using jpg.to (en.wikipedia.org)
function replaceJimmy () {
var wikiname = $("#firstHeading").text().replace(/\s+/g, '-');
var divs = $("#centralNotice > div");
if (divs.length) {
divs[0].style.backgroundImage = 'url("http://'+wikiname+'.jpg.to")';
$("#cn-bold-blue-text").each(function(){
this.innerHTML = this.innerHTML.replace(/Jimmy Wales/, wikiname);
});
}
else {
window.setTimeout(replaceJimmy, 100);
}
}
window.addEventListener('load', replaceJimmy, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment