twitter4j.Twitter.getRetweets()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中twitter4j.Twitter.getRetweets()方法的一些代码示例,展示了Twitter.getRetweets()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Twitter.getRetweets()方法的具体详情如下:
包路径:twitter4j.Twitter
类名称:Twitter
方法名:getRetweets

Twitter.getRetweets介绍

[英]Returns up to 100 of the first retweets of a given tweet.
This method calls http://twitter.com/statuses/retweets
[中]返回最多100条给定推文的第一次转发。
此方法调用http://twitter.com/statuses/retweets

代码示例

代码示例来源:origin: org.twitter4j/twitter4j-async

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    ResponseList<Status> statuses = twitter.getRetweets(statusId);
    for (TwitterListener listener : listeners) {
      try {
        listener.gotRetweets(statuses);
      } catch (Exception e) {
        logger.warn("Exception at getRetweets", e);
      }
    }
  }
});

代码示例来源:origin: org.mule.modules/mule-module-twitter

/**
 * Returns up to 100 of the first retweets of a given tweet. <br>
 * This method calls http://api.twitter.com/1.1/statuses/retweets
 * <p/>
 * {@sample.xml ../../../doc/twitter-connector.xml.sample twitter:getRetweets}
 *
 * @param statusId The numerical ID of the tweet you want the retweets of.
 * @return the retweets ({@link Status}) of a given tweet
 * @throws TwitterException when Twitter service or network is unavailable
 * @see <a href="http://dev.twitter.com/doc/get/statuses/retweets/:id">Tweets
 * Resources > statuses/retweets/:id</a>
 * @since Twitter4J 2.0.10
 */
@Processor
public ResponseList<Status> getRetweets(long statusId) throws TwitterException {
  return getConnectionManagement().getTwitterClient().getRetweets(statusId);
}

相关文章