-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathInstagram-Auto-Follower.js
42 lines (35 loc) · 1.09 KB
/
Instagram-Auto-Follower.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
const timeoutPromise = (timeout) => new Promise((resolve) => setTimeout(resolve, timeout));
var list = document.querySelectorAll('.L3NKy');
function clikOnLink(link) {
if (link.firstChild.nodeValue == "Follow") {
link.click();
}
}
function ScrollJS(selector) {
if(selector == "suggested"){
var current = document.documentElement.scrollTop;
scrollTo(current, current+300);
}
else if(selector == "othersfollowers"){
var fDialog = document.querySelector('div[role="dialog"] .isgrP');
fDialog.scrollTop = fDialog.scrollTop + 300;
}
}
async function FollowPeople(start, end,selector) {
for (i = start; i < end; i++) {
clikOnLink(list[i]);
console.log("Person: "+i);
await timeoutPromise(10000);
}
ScrollJS(selector);
}
async function FunctionMain(selector) {
for (i = 0; i <= list.length; i + 5) {
if(i<=list.length-1){
list = document.querySelectorAll('.L3NKy');
}
FollowPeople(i, i + 5,selector);
await timeoutPromise(80000);
}
}
FunctionMain("suggested");