Greasy Fork

Greasy Fork is available in English.

看雪论坛优化显示+自动签到

移除了置顶主题,一天内发布的新帖蓝框标记显示,自动签到

目前为 2018-12-08 提交的版本,查看 最新版本

// ==UserScript==
// @name         看雪论坛优化显示+自动签到
// @description  移除了置顶主题,一天内发布的新帖蓝框标记显示,自动签到
// @namespace    http://greasyfork.icu/zh-CN/users/78403
// @version      2018.12.8
// @author       jsgod
// @icon         https://www.pediy.com//favicon.ico
// @match        https://bbs.pediy.com/forum*
// @grant		GM_setValue
// @grant		GM_getValue
// @require     http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @run-at 		document-end
// ==/UserScript==


(function ()
{
    //=========================================================================================

    $('.thread.top_1').remove();
    $('.thread.top_2').remove();
    $('.thread.top_3').remove();
    $('.thread').each(function (i, item)
    {
        var timeSpan = $(this).find("span.date.text-grey");
        if (timeSpan)
        {
            var timestr = timeSpan.html();
            if (!timestr)
            {
            }
            else if (
                timestr.includes("小时前") ||
                timestr.includes("分钟前"))
            {
                $(this).css({ "color": "blue", "border": "2px solid blue" });
            }
        }
    });
    //========================= 自动签到一下================================================================

    q签到();
    function q签到()
    {
        var curday = new Date().toLocaleDateString();
        if (curday == localStorage.pediy签到)
        {
        }
        else
        {
            $.xpost('user-signin.htm', {}, function (code, message)
            {
                console.log("执行签到返回", code, message);
                localStorage.pediy签到 = curday;
            });
        }
    }

    //=========================================================================================

})();