Package com.renren.api.client.param.impl

Examples of com.renren.api.client.param.impl.SessionKey


        String renrenUserId = request.getParameter("xn_sig_user");
        if (sessionKey != null && renrenUserId != null) {
            request.getSession().setAttribute("session_key", sessionKey);
           
            RenrenApiClient apiClient = RenrenApiClient.getInstance();
            JSONArray userInfo = apiClient.getUserService().getInfo(renrenUserId, "name,headurl",new SessionKey(sessionKey));
            if (userInfo != null && userInfo.size() > 0) {
                JSONObject currentUser = (JSONObject) userInfo.get(0);
                if (currentUser != null) {
                    String userName = (String) currentUser.get("name");
                    String userHead = (String) currentUser.get("headurl");
                    request.getSession().setAttribute("userName", userName);
                    request.getSession().setAttribute("userHead", userHead);
                }
            }
            //获取好友列表数据
            JSONArray friendsList = apiClient.getFriendsService().getFriends(1, 30,new SessionKey(sessionKey));//最多取30个好友
            //获得安装了该应用的列表
            JSONArray appuserList=apiClient.getFriendsService().getAppUsers("tinyurl",new SessionKey(sessionKey));
            request.setAttribute("friendsList", friendsList);
            request.setAttribute("appUsersList", appuserList);
        }
        request.setAttribute("appId", RenrenApiConfig.renrenAppID);
      RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/home.jsp");
View Full Code Here


          if(flag.equals("local")){
              //上传本地图片
              String filename=(String)request.getParameter("filename");
              filename=new String(filename.getBytes("ISO8859-1"),"UTF-8");
              try{
                  client.getPhotoService().uploadLocalImg(0, filename, "测试上传本地图片"+new Date(),new SessionKey(sessionKey));
              }catch(RenrenApiException e){
                  e.printStackTrace();
              }
             
          }else if(flag.equals("url")){
              //上传网络图片
              String fileurl=(String)request.getParameter("fileurl");
              try{
                  client.getPhotoService().uploadURLImg(0, fileurl, "测试上传网络图片"+new Date(),new SessionKey(sessionKey));
              }catch(RenrenApiException e){
                  e.printStackTrace();
              }
          }
      }
View Full Code Here

TOP

Related Classes of com.renren.api.client.param.impl.SessionKey

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.