Skip to content

Instantly share code, notes, and snippets.

@ir-g
Last active May 21, 2016 13:00
Show Gist options
  • Save ir-g/acb7eda16bb21aaaa31393ef63a6b455 to your computer and use it in GitHub Desktop.
Save ir-g/acb7eda16bb21aaaa31393ef63a6b455 to your computer and use it in GitHub Desktop.
rls.fkids.net userscript
// ==UserScript==
// @name rls.fkids.net homepage userscript
// @match http://rls.fkids.net
// @match http://rls.fkids.net/index.php
// @grant none
// ==/UserScript==
(function() {
for(var i in document.getElementById("page-body").children[1].children){
var curTag = document.getElementById("page-body").children[1].children[i];
var curTagName = curTag.tagName;
//console.log(curTagName);
if(curTagName == "A"){
var niceName = curTag.children[0].innerHTML.replace(/<(.|\n)*?>/,"").replace(/<(.|\n)*?>/,"").replace("'","").replace("\"","");
var unSpacedName = niceName.replace(" ","").replace(" ","").replace(/\W+/g, "").replace(/_/g,"");
var imgCode = "<img src='http:\/\/rls.fkids.net/character/"+unSpacedName+".png'></img>";
console.log(imgCode);
curTag.children[0].innerHTML = imgCode;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment