Greasy Fork

Greasy Fork is available in English.

重庆继续教育选修小节自动播放

只支持选修小节自动播放

当前为 2019-09-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         重庆继续教育选修小节自动播放
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  只支持选修小节自动播放
// @author       moxiaoying
// @match        https://rcpx.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
//     var org_text = $('.cl-catalog-playing').text();
    var url = 'https://rcpx.21tb.com/els/html/courseStudyItem/courseStudyItem.selectResource.do?host=&vbox_server=http://21tb-video.21tb.com&fromNetWorkSetting=false&chooseHttp=https:&courseType=NEW_COURSE_CENTER&eln_session_id=elnSessionId.5fdbc05182394b04be959d211d6d419d'
    var data = 'scoId=' + info.scoId +'&courseId=' + info.courseId + '&firstLoad=true&location=2348.1&elsSign=elnSessionId.5fdbc05182394b04be959d211d6d419d&current_app_id='
    $.ajax({
        url: url,
        data: data,
        async: false,
        type: 'post',
        dataType: 'json',
        success: function(data){
            console.log(parseInt(data.minStudyTime));
            setTimeout(function(){
               window.location.reload();
            },1000*60*parseInt(data.minStudyTime));
        },
        error: function(d){
            setInterval(function(){
                //         var now_text = $('.cl-catalog-playing').text();
                var min_time = parseInt($('#minStudyTime').text());
                var studied_time =  parseInt($('#studiedTime').text());
                if(min_time-studied_time<=1){
                    window.location.reload();
                }
                console.log('studied_time:'+studied_time+'min_time:'+min_time);
            }, 1000*60);
        }
    });
    // Your code here...
})();