从特定用户获取对特定推文的推文回复 [英] Getting tweet replies to a particular tweet from a particular user
问题描述
我正在尝试浏览特定用户的推文并获得对该推文的所有回复.发现twitter的APIv1.1不直接支持.
I am trying to go through tweets of a particular user and get all replies on that tweet. I found that the APIv1.1 of twitter does not directly support it.
是否有获取特定推文回复的技巧或解决方法.我正在使用 python 流 API.
Is there a hack or a workaround on getting the replies for a particular tweet. I am using python Streaming API.
推荐答案
有一个使用 REST API 的解决方法.
There is a workaround using the REST API.
您将需要要查找回复的原始推文作者的 id_str 和 @username.
You will need the id_str and @username of the author of the original tweet you want to find replies to.
对于作者的@username",您应该使用 Search API.浏览结果以查找in_reply_to_status_id"字段,以与您想要回复的特定推文的 id_str 进行比较.
You should use the Search API for the "@username" of the author. Go through the results looking for the 'in_reply_to_status_id' field to compare to the id_str of the specific tweet you want replies for.
这篇关于从特定用户获取对特定推文的推文回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!