首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 互联网 >

新浪SDK异常解析(1)

2012-07-27 
新浪SDK错误解析(1)本错误是在实际使用新浪的SDK进行开发时遇到的错误接口描述:获取某个用户最新发表的微

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

热点排行