Created
November 10, 2013 02:07
-
-
Save axolx/7392708 to your computer and use it in GitHub Desktop.
My Instagram account got hacked and next time I logged in I was following >500 spammers. Instead of using the UI to unfollow them (painfully slow) I put together this little script.
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
from instagram.client import InstagramAPI | |
from instagram.bind import InstagramAPIError, InstagramClientError | |
from time import sleep | |
access_token = "SETMET" | |
api = InstagramAPI(access_token=access_token) | |
follows = api.user_follows(MY_USERID) | |
for user in follows[0]: | |
print "Unfollowing: " + user.username | |
api.unfollow_user(user_id=user.id) | |
sleep(2) # be nice or get blocked from the API endpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How does this works? Excuse me I'm new with this and want to unfollow masively. I speak spanish so, sorry for my bad english