Example usage for twitter4j Twitter getIncomingFriendships

List of usage examples for twitter4j Twitter getIncomingFriendships

Introduction

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

Prototype

IDs getIncomingFriendships(long cursor) throws TwitterException;

Source Link

Document

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

Usage

From source file:com.dwdesign.tweetings.loader.IncomingFriendshipsLoader.java

License:Open Source License

@Override
public IDs getIDs() throws TwitterException {
    final Twitter twitter = getTwitter();
    if (twitter == null)
        return null;
    return twitter.getIncomingFriendships(-1);
}

From source file:de.vanita5.twittnuker.loader.support.IncomingFriendshipsLoader.java

License:Open Source License

@Override
protected IDs getIDs(final Twitter twitter, final CursorPaging paging) throws TwitterException {
    if (twitter == null)
        return null;
    return twitter.getIncomingFriendships(paging);
}

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

License:Apache License

/**
 * Usage: java twitter4j.examples.friendship.GetIncomingFriendships
 *
 * @param args message//from w  w  w .  j ava  2s.  c  o m
 */
public static void main(String[] args) {
    try {
        Twitter twitter = new TwitterFactory().getInstance();
        long cursor = -1;
        IDs ids;
        System.out.println("Showing incoming pending follow request(s).");
        do {
            ids = twitter.getIncomingFriendships(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 incoming friendships: " + te.getMessage());
        System.exit(-1);
    }
}