Lazy Student for dk

robot for dk.91huayi.com

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Lazy Student for dk
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  robot for dk.91huayi.com
// @author       han2ee
// @match        http://dk.91huayi.com/*
// @match        http://dk.91huayi.com/course_ware/*
// @run-at       document-start
// @grant unsafeWindow
// ==/UserScript==

function playend() {
    //if (getDuration($("#ccid").val()) - getPosition($("#ccid").val()) < 200) {
    //var uid = '437c3b4b-0243-49ef-bd94-ce305122416c';
    //var cwrid = 'aa149adf-2eec-4234-a9df-2d60b6b03b31';
    //var cwid = 'b9cd9a3c-554a-450c-b138-0d47389f7373';

    $.ajax({
        type: "POST",
        url: "../ashx/CourseWareFinish.ashx",
        data: {
            "uid": uid,
            "cwrid": cwrid,
            "iscommpany": ""
        },
        dataType: "text",
        error: function () {
            //alert("更新学习记录失败");
        },
        success: function (res) {
            console.log("end play");
            //alert(res);
            window.location = "http://dk.91huayi.com/exam/myexam_info.aspx";
        }
    });
    //}
}

(function() {
    'use strict';
    setInterval(function(){
        if(document.URL.startsWith('http://dk.91huayi.com/course_ware/course_ware_cc.aspx')) {
            playend();

        } else if(document.URL.startsWith('http://dk.91huayi.com/exam/myexam_info.aspx')){
            if($("table a img")[0].title.startsWith("(未学习)")) {
                window.location = $("table a")[0].href;
            }
        }
    }, 3000);
})();