twitter4j.Status.isFavorited()方法的使用及代码示例

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

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

Status.isFavorited介绍

[英]Test if the status is favorited
[中]测试状态是否有利

代码示例

代码示例来源:origin: stackoverflow.com

ResponseList<Status> result = twitter.getFavorites();
   for (Status status : result)
   {
     System.out.println(status.getText());
     System.out.println(status.isFavorited());
   }

代码示例来源:origin: stackoverflow.com

QueryResult result = twitter.search(new Query("Some term"));
   for (Status status : result.getTweets())
   {
     System.out.println(status.getText());
     System.out.println(status.getFavoriteCount());
     System.out.println(status.isFavorited());
   }

代码示例来源:origin: Tristan971/Lyrebird

/**
 * Returns whether or not the given tweet has not yet been liked and that thus the interaction with it should be to
 * like it.
 *
 * @param tweet the tweet to check
 *
 * @return true if the given tweet is not liked yet but the current user
 */
boolean notYetLiked(final Status tweet) {
  return !sessionManager.doWithCurrentTwitter(twitter -> twitter.showStatus(tweet.getId()).isFavorited())
             .get();
}

代码示例来源:origin: Tristan971/Lyrebird

/**
 * Called on click of the like button.
 * <p>
 * Will call {@link #updateLikeVisual(boolean)} on task finish to set the appropriate visual value.
 *
 * @see TwitterInteractionService
 * @see TwitterBinaryInteraction
 * @see StatusInteraction#LIKE
 */
private void onLike() {
  LOG.debug("Like interaction on status {}", targetStatus.getValue().getId());
  likeButton.setDisable(true);
  CompletableFuture.supplyAsync(
      () -> interactionService.interact(targetStatus.getValue(), LIKE)
  ).thenAcceptAsync(res -> {
    updateLikeVisual(res.isFavorited());
    likeButton.setDisable(false);
  }, Platform::runLater);
}

代码示例来源:origin: Tristan971/Lyrebird

@Override
public void initialize() {
  setUpInteractionActions();
  targetStatus.addListener((o, prev, cur) -> {
    updateRetweetVisual(cur.isRetweet() ? cur.getRetweetedStatus().isRetweeted() : cur.isRetweeted());
    updateLikeVisual(cur.isFavorited());
  });
}

代码示例来源:origin: jcustenborder/kafka-connect-twitter

.put("InReplyToUserId", status.getInReplyToUserId())
.put("InReplyToScreenName", status.getInReplyToScreenName())
.put("Favorited", status.isFavorited())
.put("Retweeted", status.isRetweeted())
.put("FavoriteCount", status.getFavoriteCount())

相关文章