本文整理了Java中twitter4j.Status.getId()
方法的一些代码示例,展示了Status.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Status.getId()
方法的具体详情如下:
包路径:twitter4j.Status
类名称:Status
方法名:getId
[英]Returns the id of the status
[中]返回状态的id
代码示例来源:origin: google/data-transfer-project
status.getText(),
null,
Long.toString(status.getId()),
null,
false));
代码示例来源:origin: stackoverflow.com
Status status;
String url= "https://twitter.com/" + status.getUser().getScreenName()
+ "/status/" + status.getId();
System.out.println(url);
代码示例来源:origin: apache/flume
private Record extractRecord(String idPrefix, Schema avroSchema, Status status) {
User user = status.getUser();
Record doc = new Record(avroSchema);
doc.put("id", idPrefix + status.getId());
doc.put("created_at", formatterTo.format(status.getCreatedAt()));
doc.put("retweet_count", status.getRetweetCount());
doc.put("retweeted", status.isRetweet());
doc.put("in_reply_to_user_id", status.getInReplyToUserId());
doc.put("in_reply_to_status_id", status.getInReplyToStatusId());
addString(doc, "source", status.getSource());
addString(doc, "text", status.getText());
MediaEntity[] mediaEntities = status.getMediaEntities();
if (mediaEntities.length > 0) {
addString(doc, "media_url_https", mediaEntities[0].getMediaURLHttps());
addString(doc, "expanded_url", mediaEntities[0].getExpandedURL());
}
doc.put("user_friends_count", user.getFriendsCount());
doc.put("user_statuses_count", user.getStatusesCount());
doc.put("user_followers_count", user.getFollowersCount());
addString(doc, "user_location", user.getLocation());
addString(doc, "user_description", user.getDescription());
addString(doc, "user_screen_name", user.getScreenName());
addString(doc, "user_name", user.getName());
return doc;
}
代码示例来源:origin: org.twitter4j/twitter4j-core
@Override
public boolean equals(Object obj) {
if (null == obj) {
return false;
}
if (this == obj) {
return true;
}
return obj instanceof Status && ((Status) obj).getId() == this.id;
}
代码示例来源:origin: FutureCitiesCatapult/TomboloDigitalConnector
@Override
public String getValue() {
return status.getId() + "";
}
},
代码示例来源:origin: org.twitter4j/twitter4j-core
@Override
public int compareTo(Status that) {
long delta = this.id - that.getId();
if (delta < Integer.MIN_VALUE) {
return Integer.MIN_VALUE;
} else if (delta > Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
}
return (int) delta;
}
代码示例来源:origin: stackoverflow.com
List<Status> retweets = twitter.getRetweetedByMe();
for (Status retweet : retweets) {
if(retweet.getRetweetedStatus().getId() == ID_OF_TWEET_YOU_DONT_WANT_TO_RETWEET_ANYMORE)
twitter.destroyStatus(retweet.getId());
}
代码示例来源:origin: stackoverflow.com
public class StatusTypeHandler implements TypeHandler<Status> {
public Status getResult(ResultSet rs, String param) throws SQLException {
return Status.getEnum(rs.getInt(param));
}
public Status getResult(CallableStatement cs, int col) throws SQLException {
return Status.getEnum(cs.getInt(col));
}
public void setParameter(PreparedStatement ps, int paramInt, Status paramType, JdbcType jdbctype)
throws SQLException {
ps.setInt(paramInt, paramType.getId());
}
}
代码示例来源:origin: stackoverflow.com
StatusUpdate statusUpdate = new StatusUpdate(mfinalmsg);
if (imgdata != null) {
ByteArrayInputStream bis = new ByteArrayInputStream(imgdata);
statusUpdate.setMedia("pic", bis);
}
Status status = twitter.updateStatus(statusUpdate);
long statusId = (int)status.getId();
代码示例来源:origin: stackoverflow.com
final QueryResult result = twitter.search(query); // 100 Tweets
final Status lastStatus = getLast(result.getTweets());
query.sinceId(lastStatus.getId());
final QueryResult nextResult = twitter.search(query); // Another 100 Tweets
// and so on...
代码示例来源:origin: stackoverflow.com
boolean finished = false;
while (!finished) {
final QueryResult result = twitter.search(query);
final List<Status> statuses = result.getTweets();
long lowestStatusId = Long.MAX_VALUE;
for (Status status : statuses) {
// do your processing here and work out if you are 'finished' etc...
// Capture the lowest (earliest) Status id
lowestStatusId = Math.min(status.getId(), lowestStatusId);
}
// Subtracting one here because 'max_id' is inclusive
query.setMaxId(lowestStatusId - 1);
}
代码示例来源:origin: stackoverflow.com
AccessToken accessToken = new AccessToken(token,secret);
Twitter twitter = new TwitterFactory().getOAuthAuthorizedInstance(consumerKey,consumerSecret,accessToken);
Status status = twitter.updateStatus("My First Status Update");
statusId = (int)status.getId();
代码示例来源:origin: Tristan971/Lyrebird
/**
* Requests loading of older tweets.
*/
private void loadMoreTweets() {
getOldestTweetLoaded().ifPresent(oldestStatus -> {
getLogger().debug("Loading tweets before {}", oldestStatus.getId());
timelineBase.loadMoreTweets(oldestStatus.getId());
listView.scrollTo(oldestStatus);
});
}
代码示例来源:origin: org.apache.camel/camel-twitter
@Override
public List<Exchange> pollConsume() throws TwitterException {
List<Status> statusList = doPoll();
for (int i = 0; i < statusList.size(); i++) {
setLastIdIfGreater(statusList.get(i).getId());
}
return TwitterEventType.STATUS.createExchangeList(endpoint, statusList);
}
代码示例来源:origin: org.apache.camel/camel-twitter
private Status updateStatus(String status) throws Exception {
Status response = endpoint.getProperties().getTwitter().updateStatus(status);
log.debug("Updated status: {}", status);
log.debug("Status id: {}", response.getId());
return response;
}
}
代码示例来源:origin: org.apache.camel/camel-twitter
private Status updateStatus(StatusUpdate status) throws Exception {
Status response = endpoint.getProperties().getTwitter().updateStatus(status);
log.debug("Updated status: {}", status);
log.debug("Status id: {}", response.getId());
return response;
}
代码示例来源:origin: eshioji/trident-tutorial
private void extractRetweetedStatuses(Status tweet, Set<Content> contents, Status retweeted) {
if (retweeted != null) {
Content retweetedStatus = newBase(tweet);
retweetedStatus.setContentName(String.valueOf(retweeted.getId()));
retweetedStatus.setContentType("status_retweeted");
contents.add(retweetedStatus);
}
}
代码示例来源:origin: Tristan971/Lyrebird
/**
* @return The previously oldest loaded tweets for use in {@link #loadMoreTweets()}.
*/
private Optional<Status> getOldestTweetLoaded() {
if (tweetsProperty.isEmpty()) {
getLogger().debug("No older tweets to load.");
return Optional.empty();
}
final Status oldest = tweetsProperty.getValue().get(tweetsProperty.size() - 1);
getLogger().debug("Loading tweets before {}", oldest.getId());
return Optional.of(oldest);
}
代码示例来源: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: org.tomitribe/chatterbox-twitter-impl
private void replyTo(final Status status, final String reply, final boolean prefix) throws TwitterException {
final String message;
if (prefix) {
message = "@" + status.getUser().getScreenName() + " " + reply;
} else {
message = reply;
}
final StatusUpdate statusUpdate = new StatusUpdate(message);
statusUpdate.setInReplyToStatusId(status.getId());
twitter.updateStatus(statusUpdate);
}
内容来源于网络,如有侵权,请联系作者删除!