twitter / hbc

A Java HTTP client for consuming Twitter's realtime Streaming API
https://developer.twitter.com/en/docs/tweets/filter-realtime/overview
Apache License 2.0
962 stars 373 forks source link

Get users who retweeted my tweet : getRetweetedBy() not working #91

Closed farahnaj closed 10 years ago

farahnaj commented 10 years ago

I am using following code but it gives me an error like Twitter do not have such method and giving me suggestions to use getRetweets() method. I want list of users and not list of tweets.

Please give me some guidelines how to do this.

Thanks in advance.

try { Twitter twitter = new TwitterFactory().getInstance();

        int page = 1;
         List<User> users;
        do {
            users = twitter.getRetweetedBy(Long.parseLong(args[0]), new Paging(page, 100));
            for (User user : users) {
                System.out.println("@" + user.getScreenName());
            }
            page++;
        } while (users.size() != 0);
        System.out.println("done.");
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to retweeted users: " + te.getMessage());
        System.exit(-1);
    }
kevinoliver commented 10 years ago

This looks like a Twitter4J question to me, not a streaming question…