// ==UserScript== // @name NexusPHP魔力计算器 // @namespace http://tampermonkey.net/ // @version 1.2 // @description try to take over the world! // @author LaneLau // @match *.m-team.cc/adult* // @match *avgv.cc/torrents* // @match *.pttime.org/torrents* // @match *.ptsbao.club/torrents* // @match *.pthome.net/torrents* // @match *.m-team.cc/torrents* // @match *.pt.m-team.cc/adult* // @match *.hddolby.com/torrents* // @match *.leaguehd.com/torrents_movie* // @match *.hdhome.org/torrents* // @match *.hdsky.me/torrents* // @match *.ourbits.club/torrents* // @match *.u2.dmhy.org/torrents* // @match *.hdzone.me/torrents* // @match *.hdatmos.club/torrents* // @match *.pt.soulvoice.club/torrents* // @match *.discfan.net/torrents* // @match *.hdtime.org/torrents* // @grant none // @downloadURL none // ==/UserScript== (function ($) { var T0 = 4; var N0 = 7; var B0 = 50; var L = 300; function calcA(T, S, N) { var c1 = 1 - Math.pow(10, -(T / T0)); var c2 = 1 + Math.pow(2, .5) * Math.pow(10, -(N - 1) / (N0 - 1)); return c1 * S * c2; } function makeA($this, i_T, i_S, i_N) { var time = $this.children('td:eq(' + i_T + ')').find("span").attr("title"); var T = (new Date().getTime() - new Date(time).getTime()) / 1e3 / 86400 / 7; var size = $this.children('td:eq(' + i_S + ')').text().trim(); var size_tp = 1; var S = size.replace(/[KMGT]B/, function (tp) { if (tp == "KB") { size_tp = 1 / 1024 / 1024; } else if (tp == "MB") { size_tp = 1 / 1024; } else if (tp == "GB") { size_tp = 1; } else if (tp == "TB") { size_tp = 1024; } return ""; }); S = parseFloat(S) * size_tp; var number = $this.children('td:eq(' + i_N + ')').text().trim(); var N = parseInt(number); var A = calcA(T, S, N).toFixed(2); var ave = (A / S).toFixed(2); if ((A > S * 2) && (N != 0)) { //标红A大于体积2倍且不断种的种子 return '' + ave + "" } else { return '' + ave + "" } } var i_T, i_S, i_N $('.torrents>tbody>tr').each(function (row) { var $this = $(this); if (row == 0) { $this.children('td').each(function (col) { if ($(this).find('img.time').length) { i_T = col } else if ($(this).find('img.size').length) { i_S = col } else if ($(this).find('img.seeders').length) { i_N = col } }) if (!i_T || !i_S || !i_N) { alert('未能找到数据列') return } $this.children("td:last").before("