Created
November 11, 2010 13:37
-
-
Save hlfshell/672511 to your computer and use it in GitHub Desktop.
Wipe your twitter messages in your account
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
#! /usr/bin/env python | |
import twitter, time | |
from getpass import getpass | |
consumerKey = 'CONSUMERKEY' | |
consumerSecret = 'CONSUMERSECRET' | |
accessToken = 'ACCESSTOKEN' | |
accessSecret = 'ACCESSSECRET' | |
userName = raw_input('Please enter your username: ') | |
password = getpass('Please enter your password: ') | |
twitterService = twitter.Api(consumerKey, consumerSecret, accessToken, accessSecret) | |
#Check to see if we connected and run the program only while we have connections. | |
while True: | |
try: | |
twitterService.VerifyCredentials() | |
except: | |
print 'Connection to twitter lost' | |
break | |
twitterUser = twitterService.GetUser(userName) | |
tmpStatus = twitterUser.GetStatus() | |
for count in range(twitterUser.GetStatusesCount()): | |
try: | |
tmpStatus = twitterService.GetUserTimeline(userName, max_id = tmpStatus.GetId())[0] | |
print tmpStatus.GetText() | |
print twitterService.DestroyStatus(tmpStatus.GetId()) | |
except: | |
print 'Failed. Waiting for a bit.' | |
time.sleep(5) | |
if count % 10 == 0: | |
print 'On status #' + str(count) | |
break | |
print 'Complete!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work anymore- it's ancient code back on Twitter's 1.0 auth/api. Kept up for... prosperity?