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

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


            long currentTime = System.currentTimeMillis() / 1000;
            long expiresTime = currentTime - expiresIn;//即将过期的时间点(秒数)
            request.getSession().setAttribute("expiresTime", expiresTime);
            //调用SDK获得用户信息
            RenrenApiClient apiClient = RenrenApiClient.getInstance();
            int rrUid = apiClient.getUserService().getLoggedInUser(new AccessToken(accessToken));
            JSONArray userInfo = apiClient.getUserService().getInfo(String.valueOf(rrUid),
                "name,headurl,email", new AccessToken(accessToken));
            if (userInfo != null && userInfo.size() > 0) {
                JSONObject currentUser = (JSONObject) userInfo.get(0);
                if (currentUser != null) {
                    String name = (String) currentUser.get("name");
                    String headurl = (String) currentUser.get("headurl");
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 AccessToken(accessToken));
              }catch(Exception e){
                  request.setAttribute("errMsg", e.getMessage());
                    RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/error.jsp");
                    welcomeDispatcher.forward(request, response);
              }
             
          }else if(flag.equals("url")){
              //上传网络图片
              String fileurl=(String)request.getParameter("fileurl");
              try{
                  client.getPhotoService().uploadURLImg(0, fileurl, "测试上传网络图片"+new Date(),new AccessToken(accessToken));
              }catch(Exception e){
                  request.setAttribute("errMsg", e.getMessage());
                    RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/error.jsp");
                    welcomeDispatcher.forward(request, response);
              }
View Full Code Here

        if(accessToken==null){
            response.sendRedirect("login");
            return;
        }
        RenrenApiClient apiClient = RenrenApiClient.getInstance();
        JSONArray feeds=apiClient.getFeedService().getFeed("10,11,20,21,22,23,30,31,32,33,34,35,36,40,41,50,51,52,53,54,55", 0, 1, 10,new AccessToken(accessToken));
        request.setAttribute("feedlist", feeds);
        RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/feed.jsp");
        welcomeDispatcher.forward(request, response);
  }
View Full Code Here

      String description=(String)request.getParameter("description");
      String url=(String)request.getParameter("url");
      String image=(String)request.getParameter("image");
      String caption=(String)request.getParameter("caption");
      try{
          apiClient.getFeedService().publicFeed(name, description, url, image, caption, action_name, action_link, message,new AccessToken(accessToken));
          response.sendRedirect("feed");
      }catch(RenrenApiException e){
          //TODO 处理发布失败
            request.setAttribute("errMsg", e.getMessage());
            RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/error.jsp");
View Full Code Here

            response.sendRedirect("login");
            return;
        }
        RenrenApiClient apiClient = RenrenApiClient.getInstance();
        //得到当前用户的状态列表
        JSONArray statuses=apiClient.getStatusService().getStatuses(0 ,1, 20, new AccessToken(accessToken));
        request.setAttribute("statuslist", statuses);
        request.setAttribute("user", user);
        RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/status.jsp");
        welcomeDispatcher.forward(request, response);
  }
View Full Code Here

            return;
        }
      String status=(String)request.getParameter("status");
      RenrenApiClient client=RenrenApiClient.getInstance();
      try{
          client.getStatusService().setStatus(status, new AccessToken(accessToken));
          response.sendRedirect("status");
      }catch(Exception e){
          request.setAttribute("errMsg", e.getMessage());
            RequestDispatcher welcomeDispatcher = request.getRequestDispatcher("/views/error.jsp");
            welcomeDispatcher.forward(request, response);
View Full Code Here

TOP

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

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.