Created
October 3, 2014 18:30
-
-
Save skyl/09439808346fe9cea128 to your computer and use it in GitHub Desktop.
Selectively unfollow people who don't follow you on twitter with gruesome and gory confirmation
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
import time | |
import sys | |
import tweepy | |
consumer_key = "" | |
consumer_secret = "" | |
key = "" | |
secret = "" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(key, secret) | |
api = tweepy.API(auth_handler=auth) | |
followers_ids = set(api.followers_ids()) | |
friends_ids = set(api.friends_ids()) | |
non_friends = friends_ids.difference(followers_ids) | |
for i in non_friends: | |
u = api.get_user(i) | |
print "unfollow", u.name, u.screen_name | |
answer = raw_input("Are you sure? [Y/n] ").lower() | |
if answer and answer[0] != "y": | |
continue | |
else: | |
u.unfollow() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment