/**
* @deprecated 饭否没有评论功能
* @param comment the comment text
* @param id status id
* @param cid reply comment id, can be null
* @return the comment object
* @throws WeiboException
*/
public Comment updateComment(String comment, String id, String cid) throws WeiboException {
PostParameter[] params = null;
if (cid == null)
params = new PostParameter[] {
new PostParameter("comment", comment),
new PostParameter("id", id)
};
else
params = new PostParameter[] {
new PostParameter("comment", comment),
new PostParameter("cid", cid),
new PostParameter("id", id)
};
// return new Comment(http.post(getBaseURL() + "statuses/comment.xml", params, true), this);
return new Comment(http.post(getBaseURL() + "statuses/comment.json", params, true));
}
/**
* Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.
* <br>This method calls http://api.t.sina.com.cn/statuses/comment_destroy/id.format
*
* @param statusId The ID of the status to destroy.
* @return the deleted status
* @throws WeiboException when Weibo service or network is unavailable
* @deprecated 饭否没有评论功能
* @since 1.0.5
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/comment_destroy">statuses/comment_destroy </a>
*/
public Comment destroyComment(long commentId) throws WeiboException {
return new Comment(http.delete(getBaseURL() + "statuses/comment_destroy/" + commentId + ".json?source=" + CONSUMER_KEY,
true));
/*return new Comment(http.delete(getBaseURL() + "statuses/comment_destroy/" + commentId + ".xml?source=" + CONSUMER_KEY,
true), this);*/
}
/*********************************************/
/**
* Returns the specified user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @deprecated use getFriendsStatues() instead
*/
public List<User> getFriends() throws WeiboException {
return getFriendsStatuses();
}
/**
* Returns the specified user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @since Weibo4J 2.0.9
*/
public List<User> getFriendsStatuses() throws WeiboException {
// return User.constructUsers(get(getBaseURL() + "statuses/friends.xml", true), this);
return User.constructResult(get(getBaseURL() + "users/friends.json", true));
}
/**
* Returns the specified user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param paging controls pagination
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @since Weibo4J 2.0.1
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @deprecated Use getFriendsStatuses(Paging paging) instead
*/
public List<User> getFriends(Paging paging) throws WeiboException {
return getFriendsStatuses(paging);
}
/**
* Returns the specified user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param paging controls pagination
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @since Weibo4J 2.0.9
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
*/
public List<User> getFriendsStatuses(Paging paging) throws WeiboException {
/*return User.constructUsers(get(getBaseURL() + "statuses/friends.xml", null,
paging, true), this);*/
return User.constructUsers(get(getBaseURL() + "users/friends.json", null,
paging, true));
}
/**
* Returns the specified user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param page number of page
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @deprecated Use getFriendsStatuses(Paging paging) instead
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
*/
public List<User> getFriends(int page) throws WeiboException {
return getFriendsStatuses(new Paging(page));
}
/**
* Returns the user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param id the ID or screen name of the user for whom to request a list of friends
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @deprecated use getFriendsStatuses(id) instead
*/
public List<User> getFriends(String id) throws WeiboException {
return getFriendsStatuses(id);
}
/**
* Returns the user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param id the ID or screen name of the user for whom to request a list of friends
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @since Weibo4J 2.0.9
*/
public List<User> getFriendsStatuses(String id) throws WeiboException {
/*return User.constructUsers(get(getBaseURL() + "statuses/friends/" + id + ".xml"
, false), this);*/
return User.constructUsers(get(getBaseURL() + "users/friends.json",
new PostParameter[] {new PostParameter("id", id)}
, false));
}
/**
* Returns the user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param id the ID or screen name of the user for whom to request a list of friends
* @param paging controls pagination
* @return the list of friends
* @throws WeiboException when Weibo service or network is unavailable
* @since Weibo4J 2.0.1
* @see <a href="http://open.t.sina.com.cn/wiki/index.php/Statuses/friends">statuses/friends </a>
* @deprecated use getFriendsStatuses(id,paging) instead
*/
public List<User> getFriends(String id, Paging paging) throws WeiboException {
return getFriendsStatuses(id, paging);
}
/**
* Returns the user's friends, each with current status inline.
* <br>This method calls http://api.t.sina.com.cn/statuses/friends.format
*
* @param id the ID or screen name of the user for whom to request a list of friends
* @param paging controls pa