Package com.cib.yym.homepage.bean

Examples of com.cib.yym.homepage.bean.WeiboPost


    try {     
      JSONObject jsonObj = new JSONObject(jsonResult);
      JSONArray array = jsonObj.getJSONArray("statuses");
      for(int i=0;i<array.length();i++)
      {
        WeiboPost p = new WeiboPost();
        JSONObject tmp = array.getJSONObject(i);
        p.setCreatedAt(tmp.optString("created_at"));
        p.setId(tmp.optString("id"));
        p.setContent(tmp.optString("text"));
        p.setOAuthUID(uid);
        p.setUrl(tmp.optString("source"));
       
        //TODO retweeted_status 是原帖
        if( !tmp.isNull("retweeted_status"))
        {
          JSONObject retweeted_status = tmp.getJSONObject("retweeted_status");
          if(retweeted_status!=null)
          {
            WeiboPost retweeted = new WeiboPost();
            retweeted.setId(retweeted_status.optString("id"));
           
            retweeted.setContent(retweeted_status.optString("text"));
            JSONObject originalUser = retweeted_status.getJSONObject("user");
            if(originalUser!=null)
            {
              retweeted.setOAuthUID(originalUser.optString("id"));
              retweeted.setScreenName(originalUser.optString("screen_name"));
            }
            p.setRetweeted(retweeted);
          }
        }
        result.add(p);
View Full Code Here


  }

  public WeiboPost getWeiboPost(String id)
  {
    System.out.println("getWeiboPost id="+id);
    WeiboPost p1 = new WeiboPost();
    p1.setOAuthUID("yangyiming@gmail.com");
    p1.setUrl("http://weibo.com/aaaa");
    p1.setContent("这个是一个测试");
   
    return p1;
  }
View Full Code Here

TOP

Related Classes of com.cib.yym.homepage.bean.WeiboPost

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.