从Twitter的流响应状态中找出userId

时间:2019-08-23 20:31:43

标签: twitter twitter4j twitter-streaming-api

每个Twitter文档的重点是: https://developer.twitter.com/en/docs/tweets/filter-realtime/guides/basic-stream-parameters

A comma-separated list of user IDs, indicating the users whose Tweets 
should be delivered on the stream. Following protected users is not 
supported. For each user specified, the stream will contain:

1. Tweets created by the user.
2. Tweets which are retweeted by the user.
3. Replies to any Tweet created by the user.
4. Retweets of any Tweet created by the user.
5. Manual replies, created without pressing a reply button (e.g. 
   “@twitterapi I agree”).
 ....

......

1和2很简单,要将它们从Status JSON中获取就可以了 status.getUser()。getId() 对于3,status.inReplyToUserId

对于4,status.getRetweetedStatus()。getUser()。getId()

但是你到底怎么得到最后一个?那些被提及吗?

0 个答案:

没有答案