List of usage examples for twitter4j Twitter getUserListSubscribers
PagableResponseList<User> getUserListSubscribers(long listId, long cursor) throws TwitterException;
From source file:com.dwdesign.tweetings.loader.UserListSubscribersLoader.java
License:Open Source License
@Override public List<ParcelableUser> getUsers() throws TwitterException { final Twitter twitter = getTwitter(); if (twitter == null) return null; final PagableResponseList<User> users; if (mListId > 0) { users = twitter.getUserListSubscribers(mListId, mCursor); } else {/* ww w . j a v a 2s . co m*/ final UserList list = findUserList(twitter, mUserId, mScreenName, mListName); if (list != null && list.getId() > 0) { users = twitter.getUserListSubscribers(list.getId(), mCursor); } else return null; } mNextCursor = users.getNextCursor(); mPrevCursor = users.getPreviousCursor(); final List<ParcelableUser> result = new ArrayList<ParcelableUser>(); final int size = users.size(); for (int i = 0; i < size; i++) { result.add(new ParcelableUser(users.get(i), mAccountId, (mCursor + 1) * 20 + i)); } return result; }
From source file:de.vanita5.twittnuker.loader.support.UserListSubscribersLoader.java
License:Open Source License
@Override public PagableResponseList<User> getCursoredUsers(final Twitter twitter, final CursorPaging paging) throws TwitterException { if (twitter == null) return null; if (mListId > 0) return twitter.getUserListSubscribers(mListId, paging); else if (mUserId > 0) return twitter.getUserListSubscribers(mListName.replace(' ', '-'), mUserId, paging); else if (mScreenName != null) return twitter.getUserListSubscribers(mListName.replace(' ', '-'), mScreenName, paging); return null;/*from w w w . jav a 2 s .c om*/ }
From source file:org.getlantern.firetweet.loader.support.UserListSubscribersLoader.java
License:Open Source License
@Override public PageableResponseList<User> getCursoredUsers(final Twitter twitter, final CursorPaging paging) throws TwitterException { if (twitter == null) return null; if (mListId > 0) return twitter.getUserListSubscribers(mListId, paging); else if (mUserId > 0) return twitter.getUserListSubscribers(mListName.replace(' ', '-'), mUserId, paging); else if (mScreenName != null) return twitter.getUserListSubscribers(mListName.replace(' ', '-'), mScreenName, paging); return null;/*from ww w.j a v a 2 s.com*/ }
From source file:twitter4j.examples.list.GetUserListSubscribers.java
License:Apache License
/** * Usage: java twitter4j.examples.list.GetUserListSubscribers [list id] * * @param args message/*from w w w .j a v a2s . c o m*/ */ public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: java twitter4j.examples.list.GetUserListSubscribers [list id]"); System.exit(-1); } try { Twitter twitter = new TwitterFactory().getInstance(); long cursor = -1; PagableResponseList<User> usres; do { usres = twitter.getUserListSubscribers(Integer.parseInt(args[0]), cursor); for (User list : usres) { System.out.println("@" + list.getScreenName()); } } while ((cursor = usres.getNextCursor()) != 0); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to get list subscribers: " + te.getMessage()); System.exit(-1); } }