Saturday, 1 June 2013

Little myepisodes userscript (modified for Firefox)

I have updated my myepisodes userscript to work with Firefox (link), which is apparently significantly different. It would be nice if at least all browsers had the same javascript standards... oh well.

To install, you need the Greasemonkey extension and then you can add this to it!

// ==UserScript==
// @name        myeps
// @include     http://www.myepisodes.com/*
// @version     1
// @grant       none
// ==/UserScript==

function myfunc() 
 {
  // get table by class name as array
 arr = document.getElementsByClassName('showname') 
 
  // loop over array
 for (var i = 0; i < arr.length; i++) {
   
    // get show name
   name = arr.item(i).textContent; 
   
    // add torrentz.net search
   str = "http://torrentz.eu/search?f=" + name.replace(/ /g,"+")
   
    // generate link
   link = ""+name+"" 
   
    // generate 720p link
   link_720p = ""+"(720p)"+""
   
    // update cell
   arr.item(i).innerHTML = arr.item(i).innerHTML + " " + link_720p; 
  }
 }

 // run after page has loaded
window.onload = myfunc;

No comments:

Post a Comment