followerslist = []

#get following id
for item in following:
    newlist.append(item['id'])

#get followers id
for item in followers:
    followerslist.append(item['id'])

#create final list with followers
endlist = set.difference(set(newlist), set(favorites), set(followerslist))

#create final list without followers
'''
endlist = set.difference(set(newlist), set(favorites))
'''

#use instabot
bot = InstaBot('login', 'password')

print('Number of unnecessary subscriptions:', len(endlist), '\n')

for items in endlist:
    rnd = random.randint(1, 16)
    bot.unfollow(items)
    print('Wait', 30 + rnd, 'sec')
    time.sleep(30 + rnd)

print('All done.')
Example #2
0
response = bot.unlike('https://www.instagram.com/p/CH5qV6-so6Y/')
print(response)  # if the response code is 200 that means ok

response = bot.like_recent('instagram')
print(response)  # if the response code is 200 that means ok

response = bot.comment('https://www.instagram.com/p/CH5qV6-so6Y/', comment_text='Nice Post!')
print(response)  # if the response code is 200 that means ok

response = bot.comment_recent('instagram', comment_text='Nice Post!')
print(response)  # if the response code is 200 that means ok

response = bot.follow('instagram')
print(response)  # if the response code is 200 that means ok

response = bot.unfollow('instagram')
print(response)  # if the response code is 200 that means ok

response = bot.story_view('b31ngdev')
print(response)  # if the response code is 200 that means ok

response = bot.upload_post('image.png', caption='Image 1')
print(response)  # if the response code is 200 that means ok

response = bot.upload_story('image2.png')
print(response)  # if the response code is 200 that means ok

response = bot.hashtag_posts('tbt', limit=50)
print(response)  # by default the limit is setted to 20, this is a optional parameter

response = bot.location_posts('https://www.instagram.com/explore/locations/6889842/paris-france/', limit=20)