I am creating a Twitter
bot that will follow the creator of a given status.
I have the status ID (tweet ID), but I need to grab the user ID of the user who posted the tweet in order to follow them. How can I get this? I am using the Twyton
package.
Asked
Active
Viewed 544 times
0

Forge
- 6,538
- 6
- 44
- 64

Andrew Gallimore
- 13
- 4
1 Answers
0
You should use the request statuses/show/:id
as specified in the Twitter REST API
In Twython
, you should call show_status
like this:
from twython import Twython
# define application keys here
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
twitter = Twython(consumer_key, consumer_secret, access_token, access_token_secret)
status = twitter.show_status(id='tweet_id')
print status['user']['id_str']

Forge
- 6,538
- 6
- 44
- 64