TorrentLeech V4 Enhancer

Enhance TorrentLeech

目前為 2016-12-12 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        TorrentLeech V4 Enhancer
// @author      Sandbird
// @description Enhance TorrentLeech
// @namespace   https://openuserjs.org/scripts/Sandbird/TorrentLeech_V4_Enhancer
// @include   https://torrentleech.org/torrents/*
// @include   https://www.torrentleech.org/torrents/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js
// @require  http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @grant   GM_getValue
// @grant   GM_setValue
// @grant   GM_getResourceURL
// @grant   GM_xmlhttpRequest
// @version     1
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);


function inRange(x, min, max) {
    return min <= x && x <= max;
}

$('td[class = "seeders"]').each(function(){
    var snum = $(this).html();
    $(this).empty();
    var sstyle = '';

    if(inRange(snum, 0, 50)) {
        sstyle = 'style="color:#ffffff"';
    }
    else if(inRange(snum, 51, 100)) {
        sstyle = 'style="color:#f5efd2"';
    }
    else if(inRange(snum, 101, 200)) {
        sstyle = 'style="color:#c0eca9"';
    }
    else if(inRange(snum, 201, 300)) {
        sstyle = 'style="color:#82e3af"';
    }
    else if(inRange(snum, 301, 500)) {
        sstyle = 'style="color:#5db5da"';
    }
    else if(inRange(snum, 501, 800)) {
        sstyle = 'style="color:#4d3bd1"';
    }
    else if(inRange(snum, 801, 1000)) {
        sstyle = 'style="color:#be1cc8"';
    }
    else if(inRange(snum, 1001, 10000000)) {
        sstyle = 'style="color:#bf002d"';
    }
    else{
        sstyle = 'style="font-weight:bold"';
    }

    $(this).append ('<div ' + sstyle + '>' + snum + '</div>');
});


$('*[id*=imdbOnBrowse]').each(function(){
    var imdbOnBrowse = $(this).html();
    $(this).empty();
    var test = imdbOnBrowse.replace(" &nbsp;&nbsp; ", ""); //remove that extra space
    var score = test.split(" ");
    var str1 = score[0];
    if (str1 % 1 != 0) {
	    var end = imdbOnBrowse.replace(str1, '<span style="color:#c0eca9">'+str1+' </span>');
	  } else {
	    var end = imdbOnBrowse;
  	}
	  $(this).append ('<div>' + end + '</div>');
});