// ==UserScript== // @name 湖南开放大学自动刷课 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 学习视频 // @author Aether // @match *.hnsydwpx.cn/* // @grant none // @run-at document-end // @license MIT // @downloadURL none // ==/UserScript== (function () { let hre = location.href; if ( hre == "http://www.hnsydwpx.cn/center.html" || hre == "https://www.hnsydwpx.cn/center.html" ) { setTimeout(() => {s document.querySelector('.center-main').childNodes[3].childNodes[5].childNodes[1].click() }, 3000) setTimeout(() => { try { if (document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteCount').innerHTML != '0') { document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteCount').click() document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteArr').childNodes.item(0).getElementsByTagName('button')[0].click() } } catch(err) { window.location.reload(); } }, 5000) } if ( hre.match("http://www.hnsydwpx.cn/play.html/*") || hre.match("https://www.hnsydwpx.cn/play.html/*") ) { setTimeout(() => { document.getElementById('courseCatalogue').childNodes.item(3).getElementsByTagName('div')[1].getElementsByTagName('a')[0].click() }, 5000) } if (hre == "http://www.hnsydwpx.cn/getcourseDetails.html" || hre == "https://www.hnsydwpx.cn/getcourseDetails.html" ) { setInterval(() => { var cource_list = document.getElementById('courseCatalogue').querySelector('.list-item').querySelectorAll('.item-list') var finished = true for(var i = 0; i < cource_list.length; i ++) { if (cource_list[i].querySelector('.item-list-progress').innerHTML != '100%') { finished = false break } } if (finished == true) { console.log('pass') if(hre == "http://www.hnsydwpx.cn/getcourseDetails.html") { window.location.replace('http://www.hnsydwpx.cn/center.html') } else { window.location.replace('https://www.hnsydwpx.cn/center.html') } } }, 5000); } })();