新浪微博 oauth1.0分页 获取好友

http://api.t.sina.com.cn/statuses/followers/『uid』.json?source=1610801709&&cursor=1&&count=10

 

Response response = weibo.getFollowers2();

                // System.out.println(response);

                String str = response.asString();

                // System.out.println(str);

                JSONObject jo = new JSONObject(str);
                JSONArray asonArray = jo.getJSONArray("users");

                for (int i = 0; i < asonArray.length(); i++) {
                    Object o = asonArray.get(i);
                    JSONObject jo1 = (JSONObject) o;

                    System.out.println(jo1.getString("id"));
                }

                int next_cursor = jo.getInt("next_cursor");
                System.out.println(next_cursor);

                int previous_cursor = jo.getInt("previous_cursor");
                System.out.println(previous_cursor);

  

public Response getFollowers2() throws WeiboException {
        return http.get(getBaseURL() + "statuses/followers/【uid】.json?source=1610801709&&cursor=-1&&count=10", false);
    }

  

posted @ 2012-01-06 16:47  wtx  阅读(625)  评论(0编辑  收藏  举报