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

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

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

Status.isRetweetedByMe介绍

[英]Returns true if the authenticating user has retweeted this tweet, or false when the tweet was created before this feature was enabled.
[中]如果身份验证用户转发了此推文,则返回true;如果在启用此功能之前创建了此推文,则返回false。

代码示例

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

private boolean retweetedAlready(Status status) throws TwitterException {
   if(status.isRetweetedByMe() && status.getRetweetCount() > 1 ){
   return true; // this twit retweeted by your and others
 } else if(status.isRetweetedByMe() && status.getRetweetCount() == 1 )
   return  true; // this twit only retweeted by your
 }else{
   return false; // this twit not retweeted by your but mybe others retweeted
 }

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

/**
 * Determines whether a given tweet is a retweet made by the current user. Twitter's API really is unhelpful on this
 * side so we mostly take an educated guess here, although it should be enough in most cases.
 *
 * @param status the tweet to test against
 *
 * @return true if and only if the given status is a retweet made by the current user
 */
public boolean isRetweetByCurrentUser(final Status status) {
  if (status.isRetweet()) {
    final Status retweetedStatus = status.getRetweetedStatus();
    return retweetedStatus.isRetweeted() ||
        retweetedStatus.isRetweetedByMe() ||
        sessionManager.isCurrentUser(status.getUser());
  } else {
    return false;
  }
}

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

.put("Retweet", status.isRetweet())
.put("RetweetCount", status.getRetweetCount())
.put("RetweetedByMe", status.isRetweetedByMe())
.put("CurrentUserRetweetId", status.getCurrentUserRetweetId())
.put("PossiblySensitive", status.isPossiblySensitive())

相关文章