Skip to main content
  1. Posts/

Little myepisodes.com userscript

·222 words·2 mins
Table of Contents

As a little project for today to learn some javascript, I decided to modify one of my favourite websites myepisodes.com and make it a little bit more useful, by adding torrent links directly to the show list >:)

Down below is the userscript that will modify the contents of each cell and update the link from tvrage to a torrent search engine.

Installation for Opera: #

Go to Preferences > content > javascript options > User javascript folder.

Set a folder to put your user javascripts if you haven’t, otherwise add this script to that folder.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @include http://myepisodes.com/*
// ==/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
   var name = arr.item(i).innerText; 
    
    // add torrentz.net search
   var str = "http://torrentz.eu/search?f=" + name.replace(/ /g,"+")
    
    // generate link
   link = "<a href="+str+">"+name+"</a>"
    
    // generate 720p link
   link_720p = "<a href="+str+" +720p"+">"+"(720p)"+"</a>"
    
    // update cell
   arr.item(i).innerHTML = link + " " + link_720p; 
  }
 }
 
 // run after page has loaded
window.onload = myfunc;

Original post on web.archive.org.