Empornium Show Popular

By jordi2k Last update Apr 1, 2008 — Installed 402 times. Daily Installs: 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 2, 0, 3, 0, 0, 0, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1
// --[greasemonkey meta data start]--
// title: Empornium Show Popular
// version: 1.1 beta
// created: 2008-04-01
// copyright: (c) 2008, jordi2k
// license: [url=GPL license]http://www.gnu.org/copyleft/gpl.html[/url]
// description: [url=Empornium]http://empornium.us[/url] is a members only **ahem** adult site. Use this script to show only torrents with high seedcount.
// --[greasemonkey meta data stop]--
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name          Empornium Show Popular
// @description   Shows only popular torrents with more than "threshold" seeds. You can change threshold ofcourse.
// @include       *empornium.us/*
// @exclude       http://forums.empornium.us/*
// ==/UserScript==

(
   function() {
   	if(document.location.href.indexOf("browse.php") >= 0) {

   		var newCode = ""; // new HTML code for table
		var threshold = 30; // threshold for seedcount, lower than this will not be showed
      
   		var tables = document.getElementsByTagName("TABLE");        
	
		if(tables.length >= 4) {

			var row = tables[11].rows; //this table contains the torrentslisting
			var rowLength = row.length;

			newCode+='<table border="1" cellspacing=0 cellpadding=5>';
			newCode+='<tr style="background-color:#7698B5;">';
			newCode+=row[0].innerHTML; // row contains type etc
			newCode+='</tr>';
			newCode+='<tr>';
			newCode+=row[1].innerHTML; // row contains torrents added date
			newCode+='</tr>';

			for (var i=2; i< rowLength;i++) {
				if (row[i].cells.length != 10) {
					newCode+='<tr>';
					newCode+=row[i].innerHTML; // row contains torrents added date
					newCode+='</tr>';
				}
				if (row[i].cells.length == 10) {

					if (row[i].cells[7].textContent >= threshold) { //cells7] contains seedcount

						newCode+='<tr class="highlight">';
						newCode+=row[i].innerHTML;
						newCode+='</tr>';
					}
				}
			}
			newCode+= '</table>';
			tables[11].innerHTML = newCode;
     		}
     	}

   }
   )();