Greasy Fork

Greasy Fork is available in English.

CUIT dailyReport Automator

Automatically complete the online service health check-in process of Chengdu University of Information Technology.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         CUIT dailyReport Automator
// @name:zh      成都信息工程大学健康打卡自动化
// @name:zh-CN   成都信息工程大学健康打卡自动化
// @namespace    http://jszx.cuit.edu.cn/
// @version      0.1.3
// @license      Anti 996 License
// @description  Automatically complete the online service health check-in process of Chengdu University of Information Technology.
// @description:zh 自动完成成都信息工程大学线上服务健康打卡过程。
// @description:zh-CN 自动完成成都信息工程大学线上服务健康打卡过程。
// @author       Zkyao
// @include      *
// @grant        none
// ==/UserScript==

//===================使用说明(必读)=======================
// 1.在安装本脚本时,请将CONFIG中的username改为你计算中心的学号
// 2.再把password改成你计算中心的密码,然后就可以放心食用了
// 3.使用教程:
//    3.1.首先需要自己进入计算中心,然后点击"学生-作业/考试/查卷"
//    3.2.然后就是全自动的打卡了,一般正常只需3-5s,但受浏览器和网速影响可能会稍长
//    3.3.如果过程中发现卡死(最大的可能是登录的时候卡死),直接返回计算中心首页,再点一次"学生-作业/考试/查卷"即可


//======================CONFIG======================
// Credentials for auto-login
var username = "username";
var password = "password";
//==================================================
function $(id){
    return document.getElementById(id);
}
function $$(name){
    return document.getElementsByName(name);
}
function $$$(classname){
    return document.getElementsByClassName(classname);
}
function $$$$(Tagname){
    return document.getElementsByTagName(Tagname);
}
var clickevt = document.createEvent("MouseEvents");
clickevt.initEvent("click", true, true);
//==================================================

(function() {
    'use strict';

    if(window.location.hostname == "login.cuit.edu.cn" && username == "username"){
        // username check
        alert("Please edit the script and set your username & password! \n请编辑脚本,指定你的用户名和密码!");
        alert("The script will now terminate. \n脚本执行中断。");
        return false;

    }

    if(window.location.hostname == "login.cuit.edu.cn"){
        $("txtId").value = username;
        $("txtMM").value = password;
        $$$("IbtnEnterCssClass")[0].dispatchEvent(clickevt);
    }
    if(window.location.pathname == "/Jxgl/Xs/MainMenu.asp"){
        //$$$("mn11R")[0].dispatchEvent(clickevt);
        $$$$("a")[1].dispatchEvent(clickevt);
    }
    if(window.location.pathname == "/Jxgl/Xs/netKs/sj.asp"){
        $$$$("a")[1].dispatchEvent(clickevt);
    }
    if(window.location.pathname == "/Jxgl/Xs/netKs/editSj.asp"){
        $$("sF21650_6")[0].selectedIndex = 4
        $$("sF21650_7")[0].selectedIndex = 1
        $$("sF21650_8")[0].selectedIndex = 1
        $$("sF21650_9")[0].selectedIndex = 1
        $$("B2")[0].dispatchEvent(clickevt);
    }
})();