facebook fql 检索评论

发布于 2024-11-17 07:30:32 字数 855 浏览 1 评论 0原文

显示在我的页面中发布该内容的每个人的评论

这是空白页面

我哪里出错了

  FB.api({
  method: 'fql.multiquery',
  queries: {
   query1: 'SELECT post_fbid, fromid, text, time FROM comment WHERE post_id="'+postID     +'"',
  query2: 'SELECT id, name, url, pic FROM profile WHERE id IN (SELECT fromid FROM #query1)'
 }
 });
</script>
<script>
function(response) {

var comments = response[0].fql_result_set;
var users = response[1].fql_result_set;    

//loop through the comments
for(var i = 0, j = comments.length; i<j; i++){

    for(var x = 0, y = users.length; x<y; x++){
         if(comments[i].fromid == users[x].id){
             //we have a match, this comment is from user users[x]
             //process users[x]
             //break the inner for loop, since we already have a match
         }
    }

}

}

Show comments of every one who posted it in my page

This is giving blank page

Where am i going wrong

  FB.api({
  method: 'fql.multiquery',
  queries: {
   query1: 'SELECT post_fbid, fromid, text, time FROM comment WHERE post_id="'+postID     +'"',
  query2: 'SELECT id, name, url, pic FROM profile WHERE id IN (SELECT fromid FROM #query1)'
 }
 });
</script>
<script>
function(response) {

var comments = response[0].fql_result_set;
var users = response[1].fql_result_set;    

//loop through the comments
for(var i = 0, j = comments.length; i<j; i++){

    for(var x = 0, y = users.length; x<y; x++){
         if(comments[i].fromid == users[x].id){
             //we have a match, this comment is from user users[x]
             //process users[x]
             //break the inner for loop, since we already have a match
         }
    }

}

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

趁微风不噪 2024-11-24 07:30:32

您是否正在使用新的 Facebook 评论(“已迁移”)?

也许考虑使用图形 API:

https://graph.facebook .com/comments/?ids=http://example.com/

Are you using the new Facebook comments (“migrated”)?

Perhaps consider using the graph API instead:

https://graph.facebook.com/comments/?ids=http://example.com/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文