Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
获取人人上某视频分享下的所有评论
function getComments(shareId, ownerId, startCommentId){
var count = 0;
function getComment(commentId){
var data = { shareId: shareId, owner: ownerId, commentId: commentId }
data.md5 = XN.app.share.CommentManger.getOptions("shareUrlMd5");
var xhr = new XN.net.xmlhttp({
url: "http://share.renren.com/share/comment/moreurlcomment",
data: XN.array.toQueryString(data),
onSuccess: function(r){
var data = JSON.parse(r.responseText);
count += data.comments.length;
if(data.hasMore){
getComment(data.comments[0].id);
} else {
console.log(count);
}
}
});
}
getComment(startCommentId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.