wsxy_autoSignup

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

2020/02/03のページです。最新版はこちら

このスクリプトは単体で利用できません。右のようなメタデータを含むスクリプトから、ライブラリとして読み込まれます: // @require https://updategf.qytechs.cn/scripts/396002/769714/wsxy_autoSignup.js

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name          wsxy_autoSignup
// @namespace     Vionlentmonkey
// @version       0.1
// @description   网上学院函数库:自动报名
// @require       https://greasyfork.org/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);
            }
          }
        }
      }
    }
  }
};