-
Notifications
You must be signed in to change notification settings - Fork 6
/
sc.js
60 lines (43 loc) · 1017 Bytes
/
sc.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function do_sc_like(){
state = _STATE_WAIT_TO_CLOSE;
wait_time = 6;
var div = document.querySelector('button.sc-button-like');
if(!div) {
console.log("like button not found !");
return;
}
div.click();
}
function do_sc_follow(){
state = _STATE_WAIT_TO_CLOSE;
wait_time = 6;
var div = document.querySelector('button.sc-button-follow');
if(!div) {
console.log("follow button not found !");
return;
}
div.click();
}
var soundcloud_done = false;
function do_soundcloud(){
// wait for 5 seconds
if(tick_count < 2) { return; }
if(tick_count > _TIMEOUT_IN_SECS) {
// timeout
window.close();
}
if(soundcloud_done) { return; }
soundcloud_done = true;
console.log("soundcloud_done");
console.log("config.actionType = "+config.actionType);
if (config.actionType === _ACTION_TYPE_SC_FOLLOW) {
console.log("do_sc_follow");
do_sc_follow();
return;
}
if (config.actionType === _ACTION_TYPE_SC_LIKE) {
console.log("do_sc_like");
do_sc_like();
return;
}
}