Skip to content

Instantly share code, notes, and snippets.

@iitsuraj
Last active August 15, 2019 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iitsuraj/faf086f307dcbb8fe36e33f190d60a8e to your computer and use it in GitHub Desktop.
Save iitsuraj/faf086f307dcbb8fe36e33f190d60a8e to your computer and use it in GitHub Desktop.
Instagram Follow Bot
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