美剧播出时间表 今天

适用于huo720.com

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        美剧播出时间表 今天
// @namespace   superszy
// @author      superszy
// @description 适用于huo720.com
// @match       https://huo720.com/calendar*
// @match       http://huo720.com/calendar*
// @run-at document-end
// @version     1.0.6
// ==/UserScript==

{
    const url = location.href;

    const today = new Date().getFullYear() + "-" + ((new Date().getMonth()+1)>9 ? "" : "0") + (new Date().getMonth()+1) + "-" + (new Date().getDate()>9 ? "" : "0") + new Date().getDate();
    const month1 = new Date().getFullYear() + "-" + ((new Date().getMonth()+1)>9 ? "" : "0") + (new Date().getMonth()+1) + "-01";

    const findDate = url.indexOf("date");
    const findMonth1 = url.indexOf("month1");

    var btn = "<a class=\"jump px-1 link-light\" href=";
    if ( findDate > 0 && findMonth1 == -1 ) {
        btn += "?date=" + month1;
    }
    btn += "#" + today;
    btn += " one-link-mark=\"yes\">今天</a>";

    document
        .querySelector('.jump.px-1.link-light')
        .insertAdjacentHTML('beforeBegin', btn);

    if ( findDate == -1 || findMonth1 > 0 ) {
        window.location.href = '#' + today;
    }
}