SeedHelper for T411

Permet de trier les torrent pertients pour le ratio

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

// ==UserScript==
// @name         SeedHelper for T411
// @version      1.0
// @namespace    https://www.t411.ch
// @description  Permet de trier les torrent pertients pour le ratio
// @author       M1st3rN0b0d7
// @match        https://www.t411.ch/torrents/search/*
// @match        https://www.t411.ch/top/*
// @grant        none
// @require      http://code.jquery.com/jquery-latest.js
// ==/UserScript==
function seedHelper() {
    var tab = [];
    $("table tr").each(function() {
        var arrayOfThisRow = [];
        var tableData = $(this).find('td');
        if (tableData.length > 0) {
            tableData.each(function() {
                arrayOfThisRow.push($(this)[0]);
            });
            tab.push(arrayOfThisRow);
        }
    });
    for (var ligne = 0; ligne <= 47; ligne++) {
        var tmp = tab[ligne][4].innerText;
        var tmp2 = tmp.replace(/[0-9]/g, "");
        if (parseInt(tab[ligne][8].innerText) > parseInt(tab[ligne][7].innerText) &&
            parseInt(tab[ligne][7].innerText) > 0 && (parseInt(tab[ligne][8].innerText) - parseInt(tab[ligne][7].innerText)) >= 2) {
            if (tmp2 == " heures" && parseInt(tmp) == 1) {
                tab[ligne][8].style.backgroundColor = "yellow";
                tab[ligne][4].style.color = "white";
                tab[ligne][4].style.backgroundColor = "green";
            }
            if (tmp2 == " minutes" && parseInt(tmp) <= 59) {
                tab[ligne][8].style.backgroundColor = "yellow";
                tab[ligne][4].style.color = "white";
                tab[ligne][4].style.backgroundColor = "green";
            }
        }
        if (tmp2 == " minutes" && parseInt(tmp) <= 20) {
            tab[ligne][4].style.color = "white";
            tab[ligne][4].style.backgroundColor = "green";
        }
    }
}
seedHelper();