Examples of ResponseList


Examples of twitter4j.ResponseList

                }
                resetRateLimitCache();
                myWait(0.5f);
            }

            ResponseList res = null;
            IDs ids = null;
            try {
                if (friends)
                    ids = twitter.getFriendsIDs(userName, cursor);
                else
View Full Code Here

Examples of twitter4j.ResponseList

        updateUserInfo(Arrays.asList(user));
        return user;
    }

    public User getTwitterUser() throws TwitterException {
        ResponseList list = twitter.lookupUsers(new String[]{twitter.getScreenName()});
        rateLimit--;
        if (list.size() == 0)
            return null;
        else if (list.size() == 1)
            return (User) list.get(0);
        else
            throw new IllegalStateException("returned more than one user for screen name:" + twitter.getScreenName());
    }
View Full Code Here

Examples of twitter4j.ResponseList

                // swallow it, later inquiries may be satisfied by the cache
        }
    }

    private void fillInData(Map<Long, Node> nodes) throws TwitterException {
        ResponseList response = twitter().lookupUsers(twitterIds(nodes.keySet()));
        for (Object aResponse : response) {
            User twUser = (User) aResponse;
            log.info("filling data {}:{}", twUser.getId(), twUser.getScreenName());
            Node node = nodes.get(twUser.getId());
            NAME.set(node, twUser.getScreenName());
View Full Code Here

Examples of twitter4j.ResponseList

      // getting latest ID
      this.paging.setCount(TwitterConstants.FIRST_ATTEMPT_PAGE_SIZE);

      // If I used annotations here, it won't compile under JDK 1.7
      ResponseList res = this.twitter.getHomeTimeline(paging);
      this.paging.setSinceId(((Status) res.get(0)).getId());
      HornetQTwitterLogger.LOGGER.debug(connectorName + " initialise(): got latest ID: " + this.paging.getSinceId());

      // TODO make page size configurable
      this.paging.setCount(TwitterConstants.DEFAULT_PAGE_SIZE);
View Full Code Here

Examples of twitter4j.ResponseList

   private void poll() throws Exception
   {
      // get new tweets
      // If I used annotations here, it won't compile under JDK 1.7
      ResponseList res = this.twitter.getHomeTimeline(paging);

      if (res == null || res.size() == 0)
      {
         return;
      }

      for (int i = res.size() - 1; i >= 0; i--)
      {
         Status status = (Status) res.get(i);

         ServerMessage msg = new ServerMessageImpl(this.storageManager.generateUniqueID(),
                                                   TwitterConstants.INITIAL_MESSAGE_BUFFER_SIZE);
         msg.setAddress(new SimpleString(this.queueName));
         msg.setDurable(true);
         msg.encodeMessageIDToBuffer();

         putTweetIntoMessage(status, msg);

         this.postOffice.route(msg, false);
         HornetQTwitterLogger.LOGGER.debug(connectorName + ": routed: " + status.toString());
      }

      this.paging.setSinceId(((Status) res.get(0)).getId());
      HornetQTwitterLogger.LOGGER.debug(connectorName + ": update latest ID: " + this.paging.getSinceId());
   }
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.