Question about retweet

40 views
Skip to first unread message

Gavin

unread,
Dec 1, 2009, 5:15:37 AM12/1/09
to Twython Talk
What's the id stands for? The status.id of the tweet?
Could you write an example for retweet?

Thanks

Ryan McGrath

unread,
Dec 1, 2009, 1:57:16 PM12/1/09
to Twython Talk
Ah, yeah, check out the example below...

Basically, every individual tweet has an ID associated with it, and
you can get them back any number of ways - e.g, if you pull down a
feed, you'll have a tweet's ID. Same goes for pulling down user data,
etc (you'll have the ID for their most recent).

That said, this might help...

--------------------------------------------------------------------------------------

import twython

twitter = twython.setup("username", "password")

homeTimeline = twitter.getHomeTimeline()

# Loop through our results, find one that contains "Firefox", reTweet
it
for tweet in homeTimeline:
if "Firefox" in tweet["text"]:
twitter.reTweet(tweet["id"])

--------------------------------------------------------------------------------------

Since Google Groups will inevitably kill the formatting there, you can
check out that code (with highlighting and such) on GitHub:
http://gist.github.com/246528

- Ryan
Reply all
Reply to author
Forward
0 new messages