学习公社平台自动学习脚本
导读:背景学习公社平台学习中,需要人工干预才可以连续学习。安装油猴自己百度导入脚本// ==UserScript== // home.php?mod=space&uid=170990 学习公社平台 // home.php?...
背景
学习公社平台学习中,需要人工干预才可以连续学习。
安装油猴
自己百度
导入脚本
// ==UserScript==
// home.php?mod=space&
uid=170990 学习公社平台
// home.php?mod=space&
uid=467642 http://tampermonkey.net/
// home.php?mod=space&
uid=1248337 0.3
// @description try to take over the world!
// home.php?mod=space&
uid=686208 You
// home.php?mod=space&
uid=195849 https://study.enaea.edu.cn/viewerforccvideo.do?courseId=*&
circleId=*
// home.php?mod=space&
uid=593100 https://www.google.com/s2/favicons?domain=enaea.edu.cn
// home.php?mod=space&
uid=609072 none
// ==/UserScript==
(function() {
'use strict';
let isLast = false;
function gotoNext(){
let todos = opener.$('table.dataTable tr:contains(%)').filter((i,v)=>
{
return $(v).find('td:nth-child(4)').text().indexOf('#') == -1 &
&
$(v).find('td:nth-child(5)').text().indexOf('100%') == -1}
)
.filter((i,v)=>
{
let vurl = $(v).find('a.saveStuCourse').attr('data-vurl');
return location.href.indexOf(vurl) == -1}
);
if(todos.length >
0){
console.log('switch to next.... reload ');
let nextCourse = $(todos[0]);
nextCourse.find('td').eq(3).text('#')
let nextVurl = nextCourse.find('a.saveStuCourse').attr('data-vurl');
location.href = nextVurl;
}
}
function autoSetEvent(){
setInterval(function(){
var aud = $("div video").get(0);
if( $(aud).prop('__ok__') != true){
aud.addEventListener("ended", video_ended);
console.log("add ended event listener.")
$(aud).prop('__ok__',true);
isLast = $('ul.cvtb-MCK-course-list li.last').text() == $('ul.cvtb-MCK-course-list li.current').text();
let notStudyList = $('div.cvtb-MCK-CsCt-studyProgress').filter((i,v)=>
$(v).text().indexOf('100%') == -1);
if(notStudyList.length == 0){
gotoNext();
}
else if(notStudyList.length >
0 &
&
$('ul.cvtb-MCK-course-list li.current').find('div.cvtb-MCK-CsCt-studyProgress').text().indexOf('100%') === 0){
notStudyList.eq(0).parent().click();
}
}
$('.dialog-button-container button:contains(继续学习)').click()
}
,3000);
}
function video_ended() {
console.log("The audio has ended");
if(isLast){
console.log('switch to next.... ');
gotoNext();
}
}
setTimeout(function(){
// debugger;
$(".continue .user_choise").click()
autoSetEvent();
}
,3000);
// Your code here...
}
)();
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 学习公社平台自动学习脚本
本文地址: https://pptw.com/jishu/290706.html