Empornium Show Popular

By reddwarf Last update Mar 25, 2006 — Installed 2,300 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 13 posts, 6 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
jordi2k Scriptwright

I modded the code to work with the current site layout..


// --[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. Thx 2 Shannon 4 layout.
// --[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='

';
newCode='';
newCode=row[0].innerHTML; // row contains type etc
newCode='';
newCode='';
newCode=row[1].innerHTML; // row contains torrents added date
newCode='';

for (var i=2; i< rowLength;i++) {
if (row[i].cells.length != 10) {
newCode+='

';
newCode+=row[i].innerHTML; // row contains torrents added date
newCode+='';
}
if (row[i].cells.length == 10) {

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

newCode+='

';
newCode+=row[i].innerHTML;
newCode+='';
}
}
}
newCode+= '
';
tables[11].innerHTML = newCode;
}
}

}
)();

 
Skorpinox User

One more thing, you can set the i in the for loop to 1.

 
Skorpinox User

You're right. I didn't notice that at first. The first four newCode+= lines are fine. The last three should be deleted/commented out. That works for me at least.

 
reddwarf Script's Author

Thx for the response.
Related to changing += to =, doesn't that also remove the "Type, Name,DL,etc" and the "Torrents added on"?
It would be very nice to get the contents of subsequent pages but I don't know with userscripts how to do that.

 
Skorpinox User

Last comment, or so I hope. :-/ Is it possible to bring entries from subsequent pages that match the threshold to the first page and so on to fill up the extra space? Also rowLenght is supposed to be rowLength of course.

 
Skorpinox User

Err, not used to how these comments work. Anyways, all the newCode lines below var rowLenght = row.length; and above for (var i=2; i< rowLength;i++) { should be newCode= instead of newCode+= to avoid adding the first torrent by default. This caused torrents below the threshold to show up.

 
Skorpinox User

newCode+='

';
newCode+='';
newCode+=row[0].innerHTML;
newCode+='';
newCode+='';
newCode+=row[1].innerHTML;
newCode+='';

should be:

newCode='

';
newCode='';
newCode=row[0].innerHTML;
newCode='';
newCode='';
newCode=row[1].innerHTML;
newCode='';

to avoid posting the first torrent even if it's below the threshold.

  reddwarf Script's Author

It's fixed and now works with firefox/greasemonkey.
If there are enough people wanting it to work for Opera, leave a comment and I will to some more updating :)

  reddwarf Script's Author

Ah yes, now I see. It works perfect with Opera userscripts, but I will release the fixed version that also works with firefox greasemonkey in a couple days.

  acardinale User

Does not seem to work.

  reddwarf Script's Author

Could you be more specific? In Firefox or Opera?

  Jeremiah User

Would be great.. except it does nothing ;-/