Skip to content

Instantly share code, notes, and snippets.

@hardiksondagar
Last active January 31, 2019 09:05
Show Gist options
  • Save hardiksondagar/4bb71e6dd384b5aaf5dd7fc93b8ae49a to your computer and use it in GitHub Desktop.
Save hardiksondagar/4bb71e6dd384b5aaf5dd7fc93b8ae49a to your computer and use it in GitHub Desktop.
Auto follow users on Instagram
/**
*
* Auto follow users on Instagram Web
*
* Tired of following users one by one. Follow below steps to automate it.
* 1. Go to some user's profile i.e. https://www.instagram.com/spacex and click on followers, popup with user list will appear.
* 2. Open console ( press F12 in chrome ) and paste all the code below.
* 3. Wait while all the users are being followed.
*
* @author : Hardik Sondagar <hardikmsondagar@gmail.com>
*
*/
var follow_class = 'L3NKy';
var follow_list_cast = 'isgrP';
var follow_duration = 20000
var follow_list_refresh_duration = 10000
function follow(user) {
user.click();
}
var follow_interval = setInterval(
function() {
var users = document.getElementsByClassName(follow_class);
var user_to_follow = null;
var i;
for (i=0; i<users.length; i++) {
if (users[i].innerText == 'Follow') {
user_to_follow = users[i];
break;
}
}
if (user_to_follow) {
console.log(user_to_follow.innerText);
follow(user_to_follow);
}
},
follow_duration
);
var refresh_list_interval = setInterval(
function() {
follow_list = document.getElementsByClassName(follow_list_cast);
follow_list[0].scrollTop = follow_list[0].scrollHeight;
},
follow_list_refresh_duration
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment