twitter4j.Twitter.getFollowersList()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中twitter4j.Twitter.getFollowersList()方法的一些代码示例,展示了Twitter.getFollowersList()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Twitter.getFollowersList()方法的具体详情如下:
包路径:twitter4j.Twitter
类名称:Twitter
方法名:getFollowersList

Twitter.getFollowersList介绍

暂无

代码示例

代码示例来源:origin: org.twitter4j/twitter4j-async

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    PagableResponseList<User> users = twitter.getFollowersList(screenName, cursor);
    for (TwitterListener listener : listeners) {
      try {
        listener.gotFollowersList(users);
      } catch (Exception e) {
        logger.warn("Exception at getFollowersList", e);
      }
    }
  }
});

代码示例来源:origin: org.twitter4j/twitter4j-async

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    PagableResponseList<User> users = twitter.getFollowersList(userId, cursor);
    for (TwitterListener listener : listeners) {
      try {
        listener.gotFollowersList(users);
      } catch (Exception e) {
        logger.warn("Exception at getFollowersList", e);
      }
    }
  }
});

代码示例来源:origin: stackoverflow.com

ConfigurationBuilder confbuilder = new ConfigurationBuilder();
 confbuilder.setOAuthAccessToken(accessToken)
     .setOAuthAccessTokenSecret(secretToken)
     .setOAuthConsumerKey(TwitterOAuthActivity.CONSUMER_KEY)
     .setOAuthConsumerSecret(TwitterOAuthActivity.CONSUMER_SECRET);
 Twitter twitter = new TwitterFactory(confbuilder.build()).getInstance();
 PagableResponseList<User> followersList;
 list=new ArrayList<String>();
 try
 {
   followersList = twitter.getFollowersList(screenName, cursor);
   // IDs followersIDs = twitter.getFollowersIDs(userId,
   // cursor);
   for (int i = 0; i < followersList.size(); i++)
   {
     User user = followersList.get(i);
     String name = user.getName();
     list.add(name);
     System.out.println("Name" + i + ":" + name);
   }
   listView.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1 , list));
   listView.setVisibility(View.VISIBLE);
   friend_list.setVisibility(View.INVISIBLE);
   post_feeds.setVisibility(View.INVISIBLE);
   twit.setVisibility(View.INVISIBLE);
 }

代码示例来源:origin: org.mule.modules/mule-module-twitter

/**
 * Returns a cursored collection of user objects for users following the specified user.<br>
 * At this time, results are ordered with the most recent following first, however, this ordering is subject to unannounced
 * change and eventual consistency issues. Results are given in groups of 20 users and multiple "pages" of results can be
 * navigated through using the next_cursor value in subsequent requests.
 * <p/>
 * {@sample.xml ../../../doc/twitter-connector.xml.sample twitter:getFollowers}
 *
 * @param cursor Causes the results to be broken into pages of no more than 20 records at a time.
 * @return Paginated list of followers
 * @throws TwitterException when Twitter service or network is unavailable
 * @see <a href="https://dev.twitter.com/docs/misc/cursoring">Using cursors to navigate collections</a>
 */
@Processor
public PagableResponseList<User> getFollowers(@Default(value = "-1") long cursor)
    throws TwitterException {
  return getConnectionManagement().getTwitterClient().getFollowersList(getConnectionManagement().getTwitterClient().getId(), cursor);
}

相关文章