Created
August 18, 2012 18:32
Revisions
-
nileshgr revised this gist
Aug 18, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ #!/usr/bin/python2 # Go to dev.twitter.com/apps and create a new app; put the information here. # You need the tweepy library. consumer_secret = '' consumer_key = '' -
nileshgr created this gist
Aug 18, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/usr/bin/python2 # Go to dev.twitter.com/apps and create a new app; put the information here. consumer_secret = '' consumer_key = '' access_token_key = '' access_token_secret = '' import tweepy auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token_key, access_token_secret) api = tweepy.API(auth) def deleteDMs(): while True: dlist = api.direct_messages() if len(dlist) >= 1: for d in dlist: print "Destroying " + d.text + "\n" d.destroy() else: break while True: dlist = api.sent_direct_messages() if(dlist) >= 1: for d in dlist: print "Destroying " + d.text + "\n" d.destroy() else: break deleteDMs()