Skip to content

Instantly share code, notes, and snippets.

@libbymiller libbymiller/removeRTs.py
Last active Jul 19, 2019

Embed
What would you like to do?
Remove RTs from all friends on twitter (makes things calmer)
#https://stackoverflow.com/questions/9291122/api-twitter-api-attributeerror-module-object-has-no-attribute-api
#pip install python-twitter
import twitter
import time
api = twitter.Api(consumer_key='xxx',
consumer_secret='xxx',
access_token_key='xxx',
access_token_secret='xxx')
print(api.VerifyCredentials())
users = api.GetFriends()
for u in users:
print u.name
print ""
api.UpdateFriendship(u.id, retweets=False)
time.sleep(6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.