Examples of exceededRateLimitation()


Examples of twitter4j.TwitterException.exceededRateLimitation()

     * if nothing related to twitter!
     */
    public static String getMessage(Exception ex) {
        if (ex instanceof TwitterException) {
            TwitterException twExc = (TwitterException) ex;
            if (twExc.exceededRateLimitation())
                return ("Couldn't process your request. You don't have enough twitter API points!"
                        + " Please wait: " + twExc.getRetryAfter() + " seconds and try again!");
            else if (twExc.isCausedByNetworkIssue())
                return ("Couldn't process your request. Network issue.");
            else
View Full Code Here

Examples of twitter4j.TwitterException.exceededRateLimitation()

                    logger.info("=> retweeted:" + selectedTweet.getText() + " " + selectedTweet.getTwitterId());
                } catch (Exception ex) {
                    logger.error("Couldn't retweet tweet:" + selectedTweet + " " + ex.getMessage());
                    if (ex instanceof TwitterException) {
                        TwitterException ex2 = ((TwitterException) ex);
                        if (ex2.exceededRateLimitation()) {
                            logger.error("Remaining hits:" + ex2.getRateLimitStatus().getRemainingHits()
                                    + " wait some seconds:" + ex2.getRateLimitStatus().getResetTimeInSeconds());
                        }
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.