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

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

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

Twitter.lookupUsers介绍

暂无

代码示例

代码示例来源:origin: loklak/loklak_server

ResponseList<User> users = twitter.lookupUsers(u);
for (User usr: users) {
  JSONObject map = user2json(usr);

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

public static HashMap<Long,String> usernameMap = new HashMap<Long,String>();

public static void requestBatch(long[] batch,Twitter twitter) throws TwitterException
{
  ResponseList<User> responseList = twitter.lookupUsers(batch);
  for(User u : responseList){
    usernameMap.put(u.getId(), u.getScreenName());
  }
}

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

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    ResponseList<User> users = twitter.lookupUsers(screenNames);
    for (TwitterListener listener : listeners) {
      try {
        listener.lookedupUsers(users);
      } catch (Exception e) {
        logger.warn("Exception at lookupUsers", e);
      }
    }
  }
});

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

@Override
  public void invoke(List<TwitterListener> listeners) throws TwitterException {
    ResponseList<User> users = twitter.lookupUsers(ids);
    for (TwitterListener listener : listeners) {
      try {
        listener.lookedupUsers(users);
      } catch (Exception e) {
        logger.warn("Exception at lookupUsers", e);
      }
    }
  }
});

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

Twitter twitter = new TwitterFactory().getInstance();
ResponseList<User> userInfo = twitter.lookupUsers(new long[]{userId1, userId2, userId3});
for(User u: userInfo){
 System.out.println(u.getScreenName() + ": " + u.getStatus().getText());
}

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

Twitter twitter = new TwitterFactory().getInstance();
ResponseList<User> userInfo = twitter.lookupUsers(new long[]{userId1, userId2, userId3});
for(User u: userInfo){
 System.out.println(u.getScreenName() + ": " + u.getStatus().getText());
}

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

finish = finish+100;
long[] ids = Longs.toArray(IDS);
ResponseList<User> userName = t.lookupUsers(ids);

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

public static void lookupUsers(long[] usersList) {
  try {
    Twitter twitter = new TwitterFactory().getInstance();
    ResponseList<User> users = twitter.lookupUsers(usersList);
    Paging paging = new Paging(1, 100);
    List<Status> statuses;

    for (User user : users) {
      statuses = twitter.getUserTimeline(user.getScreenName(), paging);
      System.out.println("\nUser: @" + user.getScreenName());
      for (Status s : statuses) {
        System.out.println(s.getText());
      }

    }
  } catch (TwitterException e) {
    e.printStackTrace();
  }
}

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

ConfigurationBuilder cb = new ConfigurationBuilder();
     cb.setDebugEnabled(true)
       .setOAuthConsumerKey(consumerKey)
       .setOAuthConsumerSecret(consumerSecret)
       .setOAuthAccessToken(accessToken)
       .setOAuthAccessTokenSecret(accessSecret);
    try 
    {
      TwitterFactory factory = new TwitterFactory(cb.build());
      Twitter twitter = factory.getInstance();
      String[] srch = new String[] {"usernameoffriend"};
      ResponseList<User> users = twitter.lookupUsers(srch);
      for (User user : users) {
       System.out.println("Friend's Name " + user.getName()); // this print my friends name
         if (user.getStatus() != null) 
         {
         System.out.println("Friend timeline");
         List<Status> statusess = twitter.getUserTimeline(user.getName());
         for (Status status3 : statusess) 
          {
             System.out.println(status3.getText());
          }
   }
 }

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

ResponseList<User> users_list = twitter.lookupUsers(searchuser);

相关文章