Package com.google.appengine.repackaged.org.json

Examples of com.google.appengine.repackaged.org.json.JSONObject


    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);
        }
View Full Code Here


  }
 
  private JSONObject findProfileAlbum(Facebook fb) throws JSONException {
    JSONArray albums = fb.query("me/albums").getJSONArray("data");
    for (int i = 0; i < albums.length(); i++) {
      JSONObject album = albums.getJSONObject(i);
      String type = album.getString("type");
      if ("profile".equals(type))
        return album;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.repackaged.org.json.JSONObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.