Last active
August 15, 2019 22:57
-
-
Save iitsuraj/faf086f307dcbb8fe36e33f190d60a8e to your computer and use it in GitHub Desktop.
Instagram Follow Bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count =0; | |
function follow(button, arrow) { | |
console.log(count); | |
button.click(); | |
count++; | |
next(arrow) | |
} | |
function next(arrow) { | |
if (arrow == null) { | |
clearInterval(x); | |
console.log('done') | |
} else { | |
arrow.click(); | |
} | |
} | |
function randomIntFromInterval(min, max) { // min and max included | |
return Math.floor(Math.random() * (max - min + 1) + min); | |
} | |
function init() { | |
var arrow = document.querySelector('.coreSpriteRightPaginationArrow'); | |
var followButton = document.querySelectorAll('header button')[1] | |
if (followButton == null || followButton == undefined) { | |
next(arrow) | |
} else { | |
if (followButton.innerText == "Following") { | |
next(arrow) | |
} else { | |
follow(followButton, arrow) | |
} | |
} | |
} | |
var x = setInterval(function(){init()}, randomIntFromInterval(5000, 10000)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment