Greasy Fork

Greasy Fork is available in English.

抖音时间管理2022.11.6

自用抖音时间管理

当前为 2022-11-09 提交的版本,查看 最新版本

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

You will need to install an extension such as Tampermonkey to install this script.

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         抖音时间管理2022.11.6
// @description  自用抖音时间管理
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *://*.douyin.com/*
// @icon         https://img.alicdn.com/imgextra/i4/O1CN01aG16y424E11XsURUd_!!6000000007358-2-tps-206-240.png
// @grant        none
// @license      AGPL License
// ==/UserScript==


//定时
setTimeout(
    function (){try{
document.getElementsByClassName("eV6rINZw")[0].innerHTML = "----------------只看5分钟---------------";
}catch(err){alert("没找到搜索框");}}
,2000)

var i = 1;
var sj="00:00"
setTimeout(function (){
    for (let i=0; i<3600; i++)task(i);
    function task(i) {setTimeout( function () {

        //console.log(document.getElementsByClassName('time-current')[0].innerText)//输入日记
        try{
            if(sj>document.getElementsByClassName('time-current')[0].innerText){alert("够钟死心了");window.opener = null; window.open('', '_self'); window.close();}
            sj=document.getElementsByClassName('time-current')[0].innerText
            document.getElementsByClassName("eV6rINZw")[0].innerHTML = "----------------5分钟到了+"+i;i++;
        }
        catch(err){console.error(err);}
    }, 1000 * i);};

},5*60*1000);//在5分钟后执行代码





//总长时间
//document.getElementsByClassName('time-duration')[0].innerText;
//当前时间
//document.getElementsByClassName('time-current')[0].innerText;





//if(document.getElementsByClassName('time-duration')[0].innerText==document.getElementsByClassName('time-current')[0].innerText){alert("够钟死心了");window.opener = null; window.open('', '_self'); window.close();}}

//setTimeout(function(){alert("Hello");window.opener = null; window.open('', '_self'); window.close();},5*60*1000);//在一定时间后执行代码

//setTimeout(() => {
//        console.log(document.getElementsByClassName('time-current')[0].innerText);
//    }, 1000);//每隔一段时间后执行代码
//setInterval(function shijian(){for(let i=5;i>0;i--){console.log(document.getElementsByClassName('time-current')[0].innerText);}},1000)//每隔一段时间后执行代码