Greasy Fork

Greasy Fork is available in English.

@@PT-site-helper

PT-site-helper PT 助手

当前为 2018-11-05 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         @@PT-site-helper
// @namespace    http://tampermonkey.net/
// @version      0.7
// @description  PT-site-helper PT 助手
// @author       You
// @match        http://hdhome.org/*
// @match        https://ourbits.club/*
// @match        https://nanyangpt.com/*
// @match        https://pt.btschool.net/*
// @match        https://pt.gztown.net/torrents.php*
// @require https://cdn.staticfile.org/jquery/1.12.2/jquery.min.js
// @require http://greasyfork.icu/scripts/373955-secretlyrequest/code/secretlyRequest.js?version=642317
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var url = window.location.origin;

    $('body, table, .torrents td').css({
        "background-color": "#efefef",
        "color": "#000"
    });
    $('table a').css('color', 'blue');

    setTimeout(function() {
        var $qiandao1 = $('#nav_block a.faqlink');
        var $qiandao2 = $('#outer a[href="index.php?action=addbonus"]');
        if ($qiandao1.length) {
            window.H.secretlyRequest($qiandao1.attr('href')).then((err) => {
                if (!err) $qiandao1.remove();
            });
        }
        if ($qiandao2.length) {
            window.H.secretlyRequest($qiandao2.attr('href')).then((err) => {
                if (!err) $qiandao1.remove();
            });
        }
    }, 2000);

    function insertButton(btnName) {
        var btn = `<button id="fn1"
        style="position: fixed; left: 10px; top: 10px; z-index: 9999; background: #fff; border: 1px solid #aaa; padding: 4px 10px;"
        >${btnName}</button>`;

        $('body').append(btn);
        $('#fn1').on('click', function () {
            start();
        });
    }

    function start() {
        var $free = $('.pro_free');
        $.each($free, (index, item) => {
            // var $tr = $(item).parents('.sticky_top');
            console.log($(item).parent());
            // $tr.find('td').css('background', 'red');
            $(item).parent().attr('style', 'background: orange !important');
        });
    }

    insertButton('只看免费');

    if (url.indexOf('gztown.net') > -1) {
        var style = `<style>
        img { display:none; }
        body,table { background-color: #fff !important; }
        .sticky_normal { background: #fff !important; }
        </style>`;
        $('head').append(style);
    }
})();