wsxy_autoSignup

网上学院函数库:自动报名

目前為 2020-02-03 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/396002/769714/wsxy_autoSignup.js

// ==UserScript==
// @name          wsxy_autoSignup
// @namespace     Vionlentmonkey
// @version       0.1
// @description   网上学院函数库:自动报名
// @require       https://gf.qytechs.cn/scripts/395748-wsxy-getdata/code/wsxy_getData.js
// @grant         none
// ==/UserScript==

const autoSign3Credit = async () => {
  // 彩蛋:需要 iframe 提升才会执行
  if (!passPhrase && window.top === window.self) {
    let courses = document.querySelectorAll('#requiredCourseTable .course');
    for await (let c of courses) {
      let coursePk = c.getElementsByClassName('coursePk')[0].textContent;
      let title = c.getElementsByClassName('title')[0].getAttribute('title');
      let jdjs = c.getElementsByClassName('jdjs')[0].textContent; // 进度
      let csInfo = await getCourseInfo(coursePk);
      let csCredit = csInfo.courseCredit;
      // 彩蛋:需要 iframe 提升才会执行
      if (window.top === window.self) {
        if (jdjs === '未报名') {
          // 自动报名高学分课程
          if (csCredit > 1) {
            console.log(`${csCredit}学分:${title}`);
            c.click();
            console.log('click:' + title);
            const info = document.getElementsByClassName('layui-layer-btn0');
            if (info.length === 1) {
              document.getElementsByClassName('layui-layer-btn0')[0].click();
              console.log('报名:' + title);
            }
          }
        }
      }
    }
  }
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址