Skip to content

Instantly share code, notes, and snippets.

@arwankhoiruddin
Last active April 18, 2018 11:10
Show Gist options
  • Save arwankhoiruddin/cf4a5ef98fffc564bde2c605ce93e608 to your computer and use it in GitHub Desktop.
Save arwankhoiruddin/cf4a5ef98fffc564bde2c605ce93e608 to your computer and use it in GitHub Desktop.
# This script use InstagramAPI provided here: https://github.com/LevPasha/Instagram-API-python/tree/master/InstagramAPI
import sys
import os
sys.path.append(os.path.abspath("yourpath/Instagram-API-python/InstagramAPI"))
from InstagramAPI import InstagramAPI
import time
import random
user = 'yourname'
pwd = 'yourpass'
api = InstagramAPI(user, pwd)
api.login()
api.getSelfUsersFollowers()
users = api.LastJson['users']
for user in users:
api.getUserFollowers(user['pk'])
userFollowers = api.LastJson['users']
for fol in userFollowers:
print 'username: ' + fol['username']
print 'full name: ' + fol['full_name']
print '=============='
if not fol['is_private']:
api.follow(fol['pk'])
print 'this user is followed'
print '====================='
time.sleep(random.randint(30, 480))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment