Package net.fortytwo.twitlogic.services.twitter

Examples of net.fortytwo.twitlogic.services.twitter.TwitterClientException


            response = dontUnderstand(request);
        } else {
            try {
                response = replyWithLink(request, link);
            } catch (BitlyClientException e) {
                throw new TwitterClientException(e);
            }
        }

        /*
response = new Tweet();
View Full Code Here


        for (UserList l : getUserLists(user)) {
            lists.put(l.getName(), l);
        }
        final UserList list = lists.get(listId);
        if (null == list) {
            throw new TwitterClientException("no such list: " + listId + " owned by user " + user);
        }

        List<User> result = new LinkedList<User>();
        for (twitter4j.User u : asList(new ListGenerator<twitter4j.User>() {
            public PagableResponseList getList(long cursor) throws TwitterException {
View Full Code Here

    public synchronized User findUserInfo(final String screenName) throws TwitterClientException {
        try {
            return new User(twitter.showUser(screenName));
        } catch (TwitterException e) {
            throw new TwitterClientException(e);
        }
    }
View Full Code Here

    public synchronized Place fetchPlace(String id) throws TwitterClientException {
        try {
            return new Place(twitter.getGeoDetails(id));
        } catch (TwitterException e) {
            throw new TwitterClientException(e);
        }
    }
View Full Code Here

    public synchronized TwitterAPILimits getLimits() throws TwitterClientException {
        try {
            return new Twitter4jLimits(twitter.getRateLimitStatus());
        } catch (TwitterException e) {
            throw new TwitterClientException(e);
        }
    }
View Full Code Here

            query = null == result ? query : result.nextQuery();
            try {
                LOGGER.info("requesting search results");
                result = twitter.search(query);
            } catch (TwitterException e) {
                throw new TwitterClientException(e);
            }

            for (Status status : result.getTweets()) {
                if (!handler.isOpen()) {
                    LOGGER.info("handler closed");
View Full Code Here

        LOGGER.info("finding lists of user " + user);

        try {
            return twitter.getUserLists(user.getScreenName());
        } catch (TwitterException e) {
            throw new TwitterClientException(e);
        }

        /*
        return asList(new ListGenerator<UserList>() {
            public PagableResponseList getList(long cursor) throws TwitterException {
View Full Code Here

    private void waitIndefinitely() throws TwitterClientException {
        synchronized (m) {
            try {
                m.wait();
            } catch (InterruptedException e) {
                throw new TwitterClientException(e);
            }
        }
    }
View Full Code Here

        PagableResponseList p;
        do {
            try {
                p = g.getList(cursor);
            } catch (TwitterException e) {
                throw new TwitterClientException(e);
            }
            l.addAll(p);
            cursor = p.getNextCursor();
        } while (p.hasNext());
View Full Code Here

            } else if (TwitterException.TOO_MANY_REQUESTS == code) {
                wait = 1000 * ex.getRateLimitStatus().getSecondsUntilReset();

                LOGGER.info("too many requests; waiting " + wait + "ms before next request");
            } else {
                throw new TwitterClientException(ex);
            }

            try {
                Thread.sleep(wait);
            } catch (InterruptedException e) {
                throw new TwitterClientException(e);
            }

            lastWait = wait;
            timeOfLastRequest = System.currentTimeMillis();
        }
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.services.twitter.TwitterClientException

Copyright © 2018 www.massapicom. 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.