-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclickToFollow.js
53 lines (38 loc) · 1.36 KB
/
clickToFollow.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
$(CLfolBodyUL).attr("id","prfollowb");
var prfollowbh = 0;
var i = 0;
var j = 0;
var uniqStr = Math.floor(Math.random() * 100);
function clickToFollow(){
setTimeout(
function(){
document.getElementById("prfollowb").scrollTo(0,$("#prfollowb ul").height());
prfollowbh = $("#prfollowb ul").height();
j = i;
$(CLfolBodyUL).find("li").each(function(){
var prUser = $(this).find(CLbtnFollow);
if ($(prUser).length !== 0){
i++;
$(prUser).attr("id","click" + uniqStr + i);
console.log(prUser);
}
});
var prClSelInt = setInterval(
function(){
if ($("#click" + uniqStr + j).length === 0) console.log("click" + j);
else {
document.getElementById("click" + uniqStr + j).click();
console.log("following - " + j);
}
if (j >= i) {
clearInterval(prClSelInt);
if (prfollowbh != $("#prfollowb ul").height() && i < 10) eval("clickToFollow()");
}
j++;
},1000
);
console.log(prfollowbh);
}, 600
);
}
clickToFollow();