新浪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

猜你喜欢

转载自zkl-1987.iteye.com/blog/1328003
今日推荐