I can't seem to get tweepy to work with replying to a specific tweet:
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) ### at this point I've grabbed the tweet and loaded it to JSON... tweetId = tweet['results'][0]['id'] api.update_status('My status update',tweetId)
The api says it takes optional parameters and in_reply_to_status_id is the first, but it seems to be ignoring it altogether. This script will post an updated status, but it does not link it as a reply to the tweetId that I'm passing.
API for reference: http://code.google.com/p/tweepy/wiki/APIReference#update_status
Anyone have any ideas? I feel like I'm missing something simple here...
Thanks in advance.
Extract Replies to a Specific Tweet using Python and TweepyYou will want to have a Twitter Developer account and you will need to add your keys within the code. Navigate to where you downloaded your code, assuring you have Tweepy installed within the same environment. The replies will be in a .
Returns full Tweet objects for up to 100 Tweets per request, specified by the id parameter.
Just posting the solution so no someone else suffers the way I did. Twitter updated the API and added an option named auto_populate_reply_metadata
All you need to do is set that to true, and the leave the rest as should be. Here is a sample:
api.update_status(status = 'your reply', in_reply_to_status_id = tweetid , auto_populate_reply_metadata=True)
Also, the status_id is the long set of digits at the end of the tweet URL. Good Luck!
I ran into the same problem, but luckily I found the solution. You just need to include the user's screen_name in the tweet:
api.update_status('@<username> My status update', tweetId)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With