`
zkl_1987
  • 浏览: 242903 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

新浪SDK错误解析(1)

 
阅读更多
本错误是在实际使用新浪的SDK进行开发时遇到的
错误接口描述:获取某个用户最新发表的微博列表
                                public List<Status> getUserTimeline(String access_token) throws WeiboException

源代码:

/**
* 获取某个用户最新发表的微博列表
*
* @return list of the user_timeline
* @throws WeiboException
*             when Weibo service or network is unavailable
* @version weibo4j-V2 1.0.0
* @see <a
*      href="http://open.weibo.com/wiki/2/statuses/user_timeline">statuses/user_timeline</a>
* @since JDK 1.5
*/
public List<Status> getUserTimeline(String access_token)
throws WeiboException {
return Status.constructStatuses(Weibo.client.get(WeiboConfig
.getValue("baseURL") + "statuses/user_timeline.json"));
}

修改成:

public List<Status> getUserTimeline(String uid)
throws WeiboException {
return Status.constructStatuses(
weibo.get(WeiboConfig.getValue("baseURL")
+ "statuses/user_timeline.json",
new PostParameter[] { new PostParameter("uid", uid)}));
}


这样就行了,不过还是要感谢新浪SDK的提供者,帮我们节省了很多时间。

我的站点:http://www.nbshare.com
原链接地址:http://www.nbshare.com/me/20111228/367.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics