You are not logged in.

  • Login

1

Friday, April 23rd 2010, 9:10pm

Python-twitter applikation um alle tweets zu löschen

Ein beispiel zum löschen aller tweets eines twitter-benutzers (retweets werden nicht entfernt):

Python Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import twitter 
import getpass
print("Welcome to detweetr!\nThis tool is designed to remove all your tweets you posted on twitter.com")
print("Note: This will delete ALL tweets.\nIf there are some messages, you want to read later, don't use this application")
print
 
usr = raw_input("Please enter your username: ")
pw = getpass.getpass("Please enter your password: ")
 
client = twitter.Api(username = usr, password = pw)
 
cont = raw_input("Do you want to continue?(y/n)")
 
if cont == "y":
	while 1:
		tweets = client.GetUserTimeline(usr)
		if tweets == []:
			break
		for tweet in tweets:
			client.DestroyStatus(tweet.id)
elif cont == "n":
	print
	print("Bye")
 
else:
	print ("Unable to read your input! Try again")


Das Twitter modul gibt es unter http://code.google.com/p/python-twitter/

This post has been edited 5 times, last edit by "malontop" (Apr 24th 2010, 1:55pm)


2

Saturday, May 22nd 2010, 10:49pm

lol gleich mal ausprobieren das Skript - nicht ;-)

Similar threads

Social bookmarks