if (!fb.isAuthorized()) {
attr(Values.APP_ID, fb.getAppId());
return template("facebookAuth");
}
JSONObject album = findProfileAlbum(fb);
if (album == null)
return rawStringUtf8("No profile album found");
final JSONArray photos = fb.query(album.getString("id") + "/photos").getJSONArray("data");
attr(Values.PHOTO_ROWS, CollUtils.split(Funcs.map(Utils.range(photos.length()), new Func<Integer, PhotoWebView>() {
@Override public PhotoWebView call(Integer photoIdx) {
final JSONObject photo;
try {
photo = photos.getJSONObject(photoIdx);
} catch (JSONException e) {
throw new IllegalArgumentException(e);
}