Skip to content

Instantly share code, notes, and snippets.

@chriskiehl
Created November 18, 2018 19:13
Show Gist options
  • Save chriskiehl/290290c79ac5ee706c293c14bbd56143 to your computer and use it in GitHub Desktop.
Save chriskiehl/290290c79ac5ee706c293c14bbd56143 to your computer and use it in GitHub Desktop.
"""
Getting rid of some garbage on the internet.
"""
import time
import twitter
api = twitter.Api(consumer_key='',
consumer_secret='',
access_token_key='',
access_token_secret='')
def all_dem_tweets():
while True:
timeline = api.GetUserTimeline(screen_name='thechriskiehl')
if timeline:
yield from [x.id_str for x in timeline]
else:
break
for tweet_id in all_dem_tweets():
print('Deleting tweet id', tweet_id)
api.DestroyStatus(tweet_id)
# throttle ourselves a wee bit
time.sleep(.6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment