in src/main/groovy/swing/greet/TwitterAPI.groovy [68:86]
def getFriends(user) {
def friends = [user]
withStatus("Loading Friends") {
def page = 1
def list = slurper.parse(new URL("http://twitter.com/statuses/friends/${user.screen_name}.xml").openStream())
while (list.length) {
list.user.collect(friends) {it}
page++
try {
list = slurper.parse("http://twitter.com/statuses/friends/${user.screen_name}.xml&page=$page")
} catch (Exception e) { break }
}
}
withStatus("Loading Friends Images") {
return friends.each {
loadImage(it.profile_image_url as String)
}
}
}