Skip to content

Instantly share code, notes, and snippets.

@libbymiller
Last active July 19, 2019 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save libbymiller/4a4400c442f1ab97cd651619d211237f to your computer and use it in GitHub Desktop.
Save libbymiller/4a4400c442f1ab97cd651619d211237f to your computer and use it in GitHub Desktop.
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