Package twitter4j

Examples of twitter4j.Paging


    public RetweetsConsumer(TwitterEndpoint te) {
        this.te = te;
    }

    public List<Status> pollConsume() throws TwitterException {
        List<Status> list = te.getTwitter().getRetweetsOfMe(new Paging(lastId));
        for (Status s : list) {
            checkLastId(s.getId());
        }
        return list;
    }
View Full Code Here


    public UserConsumer(TwitterEndpoint te) {
        this.te = te;
    }

    public List<Status> pollConsume() throws TwitterException {
        List<Status> list = te.getTwitter().getUserTimeline(te.getProperties().getUser(), new Paging(lastId));
        for (Status s : list) {
            checkLastId(s.getId());
        }
        return list;
    }
View Full Code Here

    public HomeConsumer(TwitterEndpoint te) {
        this.te = te;
    }

    public List<Status> pollConsume() throws TwitterException {
        List<Status> list = te.getTwitter().getHomeTimeline(new Paging(lastId));
        for (Status s : list) {
            checkLastId(s.getId());
        }
        return list;
    }
View Full Code Here

    public MentionsConsumer(TwitterEndpoint te) {
        super(te);
    }

    public List<Status> pollConsume() throws TwitterException {
        List<Status> list = te.getProperties().getTwitter().getMentionsTimeline(new Paging(lastId));
        for (Status s : list) {
            checkLastId(s.getId());
        }
        return list;
    }
View Full Code Here

        actualizar();
        setVisible(true);
    }
   
    public void actualizar() throws TwitterException{
        Paging pagina = new Paging();
        pagina.setCount(50);
        ResponseList<Status> listado = twitter.getHomeTimeline(pagina);
        for (int i = 0; i < listado.size(); i++) {
            statuses.addElement(listado.get(i));
        }
    }
View Full Code Here

            throw new IllegalStateException("tweets should be positive!");

        for (int trial = 0; trial < 2; trial++) {
            try {
                ResponseList rList = twitter.getUserTimeline(
                        user.getScreenName(), new Paging(currentPage + 1, tweets, 1));
                rateLimit--;
                for (Object st : rList) {
                    Tweet tw = toTweet((Status) st);
                    res.add(new JTweet(tw, user.init(tw)));
                }
View Full Code Here

        long sinceId = lastId;
        int maxPages = tweets / hitsPerPage + 1;

        END_PAGINATION:
        for (int page = 0; page < maxPages; page++) {
            Paging paging = new Paging(page + 1, tweets, sinceId);
            // avoid that more recent results disturb our paging!
            if (page > 0)
                paging.setMaxId(maxId);

            Collection<Status> tmp = twitter.getHomeTimeline(paging);
            rateLimit--;
            for (Status st : tmp) {
                // determine maxId in the first page
View Full Code Here

      if (b == null)
      {
         throw new Exception(connectorName + ": queue " + queueName + " not found");
      }

      paging = new Paging();
      TwitterFactory tf = new TwitterFactory();
      this.twitter = tf.getOAuthAuthorizedInstance(this.consumerKey,
                                                   this.consumerSecret,
                                                   new AccessToken(this.accessToken,
                                                                   this.accessTokenSecret));
View Full Code Here

TOP

Related Classes of twitter4j.Paging

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.