Example usage for twitter4j Twitter getOutgoingFriendships

List of usage examples for twitter4j Twitter getOutgoingFriendships

Introduction

In this page you can find the example usage for twitter4j Twitter getOutgoingFriendships.

Prototype

IDs getOutgoingFriendships(long cursor) throws TwitterException;

Source Link

Document

Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.

Usage

From source file:twitter4j.examples.friendship.GetOutgoingFriendships.java

License:Apache License

/**
 * Usage: java twitter4j.examples.friendship.GetOutgoingFriendships
 *
 * @param args message/*from  w  w w  .j a  va2 s  .  c  o m*/
 */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        long cursor = -1;
        IDs ids;
        System.out.println("Showing outgoing pending follow request(s).");
        do {
            ids = twitter.getOutgoingFriendships(cursor);
            for (long id : ids.getIDs()) {
                System.out.println(id);
            }
        } while ((cursor = ids.getNextCursor()) != 0);
        System.exit(0);
    } catch (TwitterException te) {
        te.printStackTrace();
        System.out.println("Failed to get outgoing friendships: " + te.getMessage());
        System.exit(-1);
    }
}