Greasy Fork

来自缓存

Greasy Fork is available in English.

编程猫社区防沉迷插件

暂时绕过编程猫社区的防沉迷系统,只是临时方案。

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         编程猫社区防沉迷插件
// @namespace    https://shequ.codemao.cn/user/3819961
// @version      0.2
// @description  暂时绕过编程猫社区的防沉迷系统,只是临时方案。
// @author       xxtg666
// @match        https://shequ.codemao.cn/work/*
// @icon         https://shequ.codemao.cn/favicon.ico
// @grant        none
// @require      http://code.jquery.com/jquery-2.1.1.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    var d = new Date();
    var hour= d.getHours();
    var x=hour>=22;
    var y=hour<8;
    var z=window.location.href;
    var lk="https://api.codemao.cn/creation-tools/v1/works/";
    var id=z.replace("https://shequ.codemao.cn/work/","");
    var playerlk="";
    $.ajax({
        type : "get",
        url :lk+id,
        async : false,
        dataType:'json',
        success : function(res){
            var data = res;
            console.log(data);
            console.log(data.type);
            switch(data.type){
                case "KITTEN3":
                    playerlk="https://player.codemao.cn/old/";
                    break;
                case "KITTEN4":
                    playerlk="https://player.codemao.cn/new/we/";
                    break;
                case "NEMO":
                    playerlk="https://nemo.codemao.cn/w/";
                    break;
            }
            console.log(playerlk);
            console.log(id);
            var e=function(){
                var i=function(){
                    document.getElementsByClassName("c-virtual_player--virtual_player")[0].innerHTML='<iframe src="'+playerlk+id+'"></iframe>';
                }
                setTimeout(i,5000);
            }
            if(x){console.warn("十点过了");e();}
            else if(y){console.warn("八点还没到");e();}
            else{console.warn("现在不是防沉迷时间!脚本没有执行")};
        }
    });
})();