Created
November 18, 2018 19:13
-
-
Save chriskiehl/290290c79ac5ee706c293c14bbd56143 to your computer and use it in GitHub Desktop.
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
""" | |
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