Set<User> users = new LinkedHashSet<User>();
for (String key : props.stringPropertyNames()) {
if (key.startsWith(TwitLogic.FOLLOWLIST)) {
String listVal = props.getString(key);
if (!CONFIG_LIST_PATTERN.matcher(listVal).matches()) {
throw new PropertyException("invalid list: " + listVal + " (should be of the form user_name/list_id)");
}
String[] parts = listVal.split("/");
User user = new User(parts[0]);
String listId = parts[1];
List<User> l = client.getListMembers(user, listId);
users.addAll(l);
} else if (key.startsWith(TwitLogic.FOLLOWUSER)) {
String screenName = props.getString(key);
if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
throw new PropertyException("invalid screen name: " + screenName);
}
// Twitter requires user IDs (as opposed to screen names) for follow filters.
User u = client.findUserInfo(screenName);
users.add(u);
} else if (key.startsWith(TwitLogic.FOLLOWFOLLOWED)) {
String screenName = props.getString(key);
if (!CONFIG_USERNAME_PATTERN.matcher(screenName).matches()) {
throw new PropertyException("invalid screen name: " + screenName);
}
// Twitter requires user IDs (as opposed to screen names) for follow filters.
User u = client.findUserInfo(screenName);