Greasy Fork

Greasy Fork is available in English.

New Userscript

try to take over the world!

当前为 2020-09-07 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://ehallapp.nju.edu.cn/qljfwapp/sys/lwAppointmentBathroom/*default/index.do
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var refresh = () => {

        var labels = document.querySelectorAll('label')
        var length = labels.length
        for (var i = 0; i < length; i++) {
            var label = labels[i]
            var text = label.innerText
            if (text.startsWith('开始时间')) label.innerText = text.split(' ')[0] + ' 22:00:00'
            if (text.startsWith('结束时间')) label.innerText = text.split(' ')[0] + ' 22:20:00'
        }

        var items = document.querySelectorAll('.lib-listdet-items')[0]
        if (items) {
            var start = items.children[4].children[2]
            var end = items.children[5].children[2]
            start.innerText = start.innerText.split(' ')[0] + ' 22:00:00'
            end.innerText = end.innerText.split(' ')[0] + ' 22:20:00'
        }

    }

    setInterval(refresh, 1000)
})();