Package com.google.code.facebookapi

Examples of com.google.code.facebookapi.FacebookJsonRestClient


      try {
        HttpServletRequest request = getRequest();
        HttpSession session = request.getSession(true);
        String sessionKey = (String) session
            .getAttribute(FacebookUtil.SESSION_KEY);
        FacebookJsonRestClient client = new FacebookJsonRestClient(
            FacebookUtil.API_KEY, FacebookUtil.SECRET_KEY,
            sessionKey);
        FacebookContact facebookUser = null;
        Long uid = client.users_getLoggedInUser();
        if (uid != null) {
          facebookUser = new FacebookContact();
          facebookUser.setUserId(uid);

          /*
           * json ile
           */
          Vector<Long> userIds = new Vector<Long>();
          /*
           * Kendi Bilgilerinide alcaz
           */
          userIds.add(uid);

          /*
           * Kullan�c� Arkadas idlerini alcaz
           */
          JSONArray friendsId = client.friends_get();
          for (int i = 0; i < friendsId.length(); i++) {
            Long obje = friendsId.getLong(i);
            userIds.add(obje);
          }

          /*
           * Ki�i bilgilerini al
           */
          JSONArray friendsDetail = client.users_getInfo(userIds,
              FacebookUtil.fields);
          List<FacebookContact> contacts = new ArrayList<FacebookContact>();
          for (int i = 0; i < friendsDetail.length(); i++) {
            JSONObject obje = friendsDetail.getJSONObject(i);
            FacebookContact contact = new FacebookContact();
View Full Code Here

TOP

Related Classes of com.google.code.facebookapi.FacebookJsonRestClient

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.