继续教育网站挂机宝

https://www.cdjxjy.com/ 网站全自动在线挂机学习&自动添加学习记录

当前为 2021-05-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         继续教育网站挂机宝
// @namespace    none
// @version      0.0.1
// @description  https://www.cdjxjy.com/ 网站全自动在线挂机学习&自动添加学习记录
// @require      http://libs.baidu.com/jquery/1.8.3/jquery.min.js
// @author       cool_li
// @match        https://www.cdjxjy.com/*
// @match        https://www.cdjxjy.com/Student/*
// @grant        GM_getValue
// @grant        GM_setValue
// ***********************************特此声明***********************************************
// 该脚本完全免费,仅供学习使用,严谨倒卖!!! 如果您是通过购买所得,请找卖家退款!!!
// 尊重作者权益,请勿在未经允许的情况下擅自修改代码和发布到其他平台!
// 作者: cool_li
// 更新时间: 2021年05月05日
// 版本: v0.0.1
// ****************************************************************************************
// ==/UserScript==
(function() {
    'use strict';

    if (GetUrlRelativePath() === "/SiteWeb/index.htm") {
        if (window.confirm('是否开始学习课程?')) {
            window.location.href='https://www.cdjxjy.com/IndexMain.aspx#/student/SelectCourseRecord.aspx'
        }
    }


    if (GetUrlRelativePath() === '/IndexMain.aspx') {
        window.setTimeout(listInit, 3000)
        var current = 0
        function listInit () {
            var w = document.fnode2
            // 课程名称(可点击)
            var aList = $(".color_span", document.fnode2.document).get()
            // 课程名称(可点击)
            var btnList = $(".xx_ben a", document.fnode2.document).get()
            // list 数据
            var litable = $(".litable", document.fnode2.document).get()
            // 翻页按钮
            var actionList = $("#AspNetPager1 > div", document.fnode2.document).eq(0).children().get()

            var map = litable.map(v => {
                if($(v).html().indexOf('已完成') > -1) {
                    return true
                } else return false
            })
            var index = map.findIndex(function (currentValue) {
                return !currentValue
            })
            console.log(index)
            if (index > -1) {
                var selectclassid = getParams('scid', btnList[index].href)
                // 锁定新的课程
                $.ajax({
                    url: "/ashx/SelectApi.ashx?a=UpdateSelectState",
                    type: "POST",
                    data: { "selectclassid": selectclassid },
                    dataType: "json",
                    success: function () {
                        current = 0
                        aList[index].click()
                        window.setTimeout(studyCourse, 3000)
                    }
                });
            } else {
                current += 1
                if (current < actionList.length) {
                    actionList[current].click()
                    window.setTimeout(listInit, 3000)
                } else {
                    console.log('没有找到需要学习的课程')
                }
            }

            function studyCourse () {
                var w = document.fnode2
                w.updata = updata

                var timer = window.setInterval(function () {
                    w.UpdateTime();
                    $.ajax({
                        url: "/ashx/SelectApi.ashx?a=UpdateLookTime",
                        type: "POST",
                        data: { "selectclassid": w.selectclassid },
                        dataType: "json",
                        success: function (data) {
                            if (w.Startime > 2700 || (data.message.indexOf('已完成') > -1) || !data) {
                                window.clearInterval(timer)
                                window.location.reload()
                                window.setTimeout(listInit, 3000)
                            }
                        }
                    });

                }, 300000);

                window.setTimeout(automaticRecording, 60000)
            }

            function updata() {
                var w = document.fnode2
                w.UpdateTime();
                $.ajax({
                    url: "/ashx/SelectApi.ashx?a=UpdateLookTime",
                    type: "POST",
                    data: { "selectclassid": w.selectclassid },
                    dataType: "json",
                    success: function (data) {}
                });
            }
            // 自动填写学习记录
            function automaticRecording () {
                var w = document.fnode2
                w.alert = function () {}
                // 点击获取评论
                var btn = $("#btncommment", document.fnode2.document).get()[0]
                // 学习记录
                var tab = $(".course-tab .tabItem", document.fnode2.document).eq(1).get()[0]
                btn.click()
                tab.click()
                window.setTimeout(function () {
                    var firstlabel = $("#UpdatePanel2 .label", document.fnode2.document).eq(0).get()[0]
                    var content = firstlabel.innerHTML || ''
                    $("#txtareainnertContents", document.fnode2.document).val(content)
                    $("#txtareaExperience", document.fnode2.document).val(content);
                    $("#btnaddRecord", document.fnode2.document).click()
                }, 3000)
            }

        }

    }

    // 获取当前窗口相对路径
    function GetUrlRelativePath(){
        return window.location.pathname
    }

    //  获取参数
    function getParams(name, target) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = target.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }
})();

QingJ © 2025

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