Skip to content

Instantly share code, notes, and snippets.

@prakhar897
Created April 10, 2020 06:48
Show Gist options
  • Save prakhar897/bb70401c6627f9335edc2b0b93f9adb2 to your computer and use it in GitHub Desktop.
Save prakhar897/bb70401c6627f9335edc2b0b93f9adb2 to your computer and use it in GitHub Desktop.
import tweepy
import threading
import time
CONSUMER_KEY = ""
CONSUMER_SECRET = ""
ACCESS_KEY = ""
ACCESS_SECRET = ""
def deleteThread(api, objectId):
try:
api.destroy_status(objectId)
print ("Deleted:", objectId)
except:
print ("Failed to delete:", objectId)
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
while(1):
timeline = api.user_timeline(count = 500)
for t in timeline:
print("in loop")
t1 = threading.Thread( target=deleteThread, args=(api, t.id) )
t1.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment