Skip to content

Instantly share code, notes, and snippets.

@r4dian
Last active October 16, 2017 12:05
Show Gist options
  • Save r4dian/4436e011f13d4185cdb6 to your computer and use it in GitHub Desktop.
Save r4dian/4436e011f13d4185cdb6 to your computer and use it in GitHub Desktop.
Delete all your (visible) twitter favs
#!/usr/bin/env python
import sys, os, time
# add the path for virtual env for running via cron
os.chdir(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/lib/python3.4/site-packages/')
import tweepy
#visit http://dev.twitter.com to create an application and get your keys
keys = dict(
consumer_key='xxxxxxxxxxxxxxxxxxxxxxxxx',
consumer_secret='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
access_token='xxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
access_token_secret='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
)
#your username
user = "@NAME_HERE"
auth = tweepy.OAuthHandler(keys['consumer_key'], keys['consumer_secret'])
auth.set_access_token(keys['access_token'], keys['access_token_secret'])
api = tweepy.API(auth)
def go():
twts = api.favorites(user)
for f in twts:
api.destroy_favorite(f.id)
if __name__ == "__main__":
while 1:
go()
time.sleep(60*10) # probably needs to be longer, idk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment