我正在尝试使用 javascript API 发表评论。我首先得到一个特定的评论列表url
:
FB.api('/fql', {q: {
query0: 'SELECT comments_fbid FROM link_stat WHERE url="'+url+'"',
query1: 'SELECT post_fbid, fromid, text, time, comments FROM comment WHERE object_id IN (SELECT comments_fbid FROM #query0) ORDER BY time DESC',
query2: 'SELECT id, name FROM profile WHERE id IN (SELECT fromid FROM #query1)'
}}, function(resp) {
...
});
然后我可以发布到comments_fbid
页面或post_fbid
回复评论列表中的现有帖子。这些由id
以下表示:
FB.login(function(resp) {
if (!resp.authResponse) return;
FB.api('/'+id+'/comments', 'post', {message: 'Hello World', function(resp) {
console.log(resp);
});
}, {scope: 'publish_stream'});
如果我发帖回复现有消息(即,发给post_fbid
),它可以正常工作,但如果我发帖到顶级评论列表(即,comments_fbid
),我会收到一个错误:
{error: {code: 1, message: "An unknown error has occurred.", type: "OAuthException"}}