-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapterStudyTime.js
More file actions
35 lines (35 loc) · 1.07 KB
/
chapterStudyTime.js
File metadata and controls
35 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// ==UserScript==
// @name autoChapterTimes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动刷超星学习通的章节访问次数
// @author bilder
// @match https://mooc1-2.chaoxing.com/mycourse/*
// @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @license GPL
// @grant none
// ==/UserScript==
var course=/.*studentcourse.*/;
var study =/.*studentstudy.*/;
var url=window.location.href
function getRandomIntInclusive(min, max) {
// get a random number
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min; //含最大值,含最小值
}
function autoclick(i){
//clik a chapter
var list= $('div[class="content1 roundcorner"] a[href!="javascript:void(0)"]');
list[i].click();
}
function bind (){
if(course.test(url))
autoclick(getRandomIntInclusive(1,25));
else
goback(); //the function exist in the icxk web
}
(function () {
'use strict';
window.onload = window.setInterval(bind,10000);
})();