简体   繁体   English

Twitter API:如何获得转推转推?

[英]Twitter API: How to get retweets for retweet?

I want to get all retweets, that similar to current retweet. 我希望得到所有转推,这与目前的转发相似。

What I mean: 我的意思是:

If someone makes retweet, I want to take his tweet id (retweet id) and take all retweets of original tweet, that user retweet. 如果有人转推,我想拿他的推文ID(转发ID)并转发原始推文的所有转发,该用户转推。

So: original tweet -> user_retweet_id 所以: 原始推文 - > user_retweet_id

get statuses/retweets/user_retweet_id.json 

/*as statuses/retweets/original_tweet_id*/

Is it possible? 可能吗?

PS: I ask it because if I took general information about retweet ( user_retweet_id ), I get an information about original tweet ( retweet_count ), but I can't get retweets from it for original tweet . PS:我问它是因为如果我获取有关转推user_retweet_id )的一般信息,我会得到有关原始推文retweet_count )的信息,但我无法从原始推文 转发

As far as I know there is no information for getting retweet of a retweet, as essentially you are retweeting the original post. 据我所知,没有关于转推转发的信息,因为基本上你正在转发原始帖子。 Just retweet an already existing retweet and you will see that you will actually retweeted the original tweet without leaving any mark about the intermediate step. 转发已经存在的转发,您将看到您实际上会转发原始推文,而不会留下关于中间步骤的任何标记。

There's no direct method for that but what you can do is 没有直接的方法,但你可以做的是

  • Extract main username of user who actually posted that tweet 提取实际发布该推文的用户的主用户名
  • Extract his timeline using twitter.showTimeline() 使用twitter.showTimeline()提取他的时间线
  • Then find your tweet using String matching 然后使用字符串匹配找到您的推文
  • This will give you original tweet ID 这将为您提供原始推文ID
  • Then you can find most 100 recent retweets using that oiginal tweet ID 然后,您可以使用该原始推文ID找到最近的100个转推

I am using twitter4j for this 我正在使用twitter4j

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM