Greasy Fork is available in English.

云端学习(第五种类型课程)

网课学习5

// ==UserScript==
// @name         云端学习(第五种类型课程)
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  网课学习5
// @author       Feng
// @include      https://tech.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do?*
// @match        https://tech.21tb.com/els/html/courseStudyItem/courseStudyItem.learn.do?*
// @grant        none
// ==/UserScript==

var a= document.getElementsByClassName("cl-head-tip");
var b= document.getElementsByClassName("cl-play cl-url-play");
if(a.length==1&&b.length==1)
{var myVar = setInterval(function(){ autoplay() }, 5000);}

function autoplay() {
var span1=document.getElementsByClassName("cl-time")[0].innerText;
var span2=document.getElementsByClassName("cl-time")[1].innerText;
if(span1==span2)
{Submit();
var span3 = document.getElementsByClassName("cl-go-link");
span3[1].click();
stopplay();}}

function stopplay() {
clearInterval(myVar);}

function Submit() {
var x=document.getElementsByClassName("top-title");
if (x.length)
{if(x[0].title=="恭喜您已经完成课程")
{var y=document.getElementsByClassName("only-one-btn elpui-layer-btn0");
y[0].click();}}}