List of usage examples for twitter4j Twitter searchUsers
ResponseList<User> searchUsers(String query, int page) throws TwitterException;
From source file:User.SearchUsers.java
License:Apache License
public String[] getResults(String name) { try {// w w w. j a v a 2s.c o m Twitter twitter = builder.twitter; int page = 1; int i = 0; ResponseList<User> users; String[] persons = new String[100]; do { users = twitter.searchUsers(name, page); for (User user : users) { String str = ""; if (user != null) { if (user.getName() != null && !user.getName().equals("null") && !user.getName().equals("")) { str = str + user.getName() + ";"; System.out.println(user.getName()); if (user.getLocation() != null) { str = str + user.getLocation() + ";"; } else { str = str + "N/A;"; } if (user.getMiniProfileImageURL() != null) { str = str + user.getProfileImageURL(); } else { str = str + "N/A"; } persons[i] = str; i++; } } } page++; } while (users.size() != 0 && page < 2); return persons; } catch (TwitterException te) { te.printStackTrace(); } return null; }