/** * Returns a single status, specified by the id parameter. The status's author will be returned inline. * <br>This method calls http://twitter.com/statuses/show * * @param id the numerical ID of the status you're trying to retrieve * @return a single status * @throws TwitterException when Twitter service or network is unavailable * @deprecated Use showStatus(long id) instead. * @see <a href="http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-statuses%C2%A0show">Twitter API Wiki / Twitter REST API Method: statuses show</a> */ public Status show(int id) throws TwitterException { return showStatus((long)id); }
@Override public void invoke(List<TwitterListener> listeners) throws TwitterException { Status status = twitter.showStatus(id); for (TwitterListener listener : listeners) { try { listener.gotShowStatus(status); } catch (Exception e) { logger.warn("Exception at showStatus", e); } } } });
ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setDebugEnabled(true) .setOAuthConsumerKey(TwitterConstantes.APIKEY) .setOAuthConsumerSecret(TwitterConstantes.APIKEYSECRET) .setOAuthAccessToken(TwitterConstantes.TOKEN) .setOAuthAccessTokenSecret(TwitterConstantes.TOKENSECRET); TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); String tweetID ="652694439584993280"; try { twitter4j.Status sts = twitter.showStatus(Long.parseLong(tweetID)); ExtendedMediaEntity[] medias = sts.getExtendedMediaEntities(); //get the media entities from the status for(ExtendedMediaEntity m : medias){ //search trough your entities System.out.println("this is a pic"," " +m.getMediaURL()); } } catch (TwitterException e) { e.printStackTrace(); }
+ status.getText()); Status status = twitter.showStatus(81642112l); System.out.println("------------------------------"); System.out.println("Showing " + status.getUser().getName()
/** * Returns a single status, specified by the id parameter below. The status's * author will be returned inline. <br> * This method calls http://api.twitter.com/1.1/statuses/show * <p/> * {@sample.xml ../../../doc/twitter-connector.xml.sample twitter:showStatus} * * @param id the numerical ID of the status you're trying to retrieve * @return a single {@link Status} * @throws twitter4j.TwitterException when Twitter service or network is unavailable * @see <a href="http://dev.twitter.com/doc/get/statuses/show/:id">GET * statuses/show/:id | dev.twitter.com</a> */ @Processor public Status showStatus(long id) throws TwitterException { return getConnectionManagement().getTwitterClient().showStatus(id); }
/** * 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(); }
/** * Checks whether a given tweet has been retweeted by the current user. * <p> * PSA : I don't care that you can retweet your own tweets. This is stupid and you should never do it. Will never * allow a PR "fixing" that pass. * * @param tweet the tweet to check * * @return Whether the given tweet had not yet been retweeted by the current user. */ public boolean notYetRetweeted(final Status tweet) { return !sessionManager.doWithCurrentTwitter(twitter -> { final Status updatedTweet = twitter.showStatus(tweet.getId()); final Status originalStatus = updatedTweet.isRetweet() ? updatedTweet.getRetweetedStatus() : updatedTweet; return originalStatus.isRetweeted(); }).get(); }
Status tweetById = twitter.showStatus(tweet.getId()); String url= "https://twitter.com/" + tweetById.getUser().getScreenName() + "/status/" + tweetById.getId();
@Override public Tweet showStatus(Long id) throws TwitterApiException { try { Status status = twitter.showStatus(id); Tweet.Builder tweetBuilder = new Tweet.Builder() .body(status.getText()) .datePosted(new DateTime(status.getCreatedAt())) .id(id) .poster(status.getUser().getScreenName()); prepareEntities(status, tweetBuilder); return tweetBuilder.build(); } catch (TwitterException e) { throw new TwitterApiException(e, e.exceededRateLimitation(), (e.getRateLimitStatus() != null && e.getRateLimitStatus().getSecondsUntilReset() > 0) ? e.getRateLimitStatus().getSecondsUntilReset() * 1000 : 0, e.getErrorCode()); } }