如何区分Facebook评论和facebook api返回的回复?

时间:2015-09-13 17:53:28

标签: node.js facebook facebook-graph-api facebook-javascript-sdk facebook-fql

我试图获取Facebook评论以及他们对每条评论和回复的回复和赞赏,但到目前为止还没有运气。

在资源管理器中尝试跟踪api:

  

/v2.4/405944472923733/feed?fields=name,comments.summary(真).filter(流).order(reverse_chronological)

我得到以下回复:

{
  "name": "XYZ Photos",
  "comments": {
    "data": [
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "cvnbkjcvnbvc",
        "created_time": "2015-09-12T18:54:59+0000",
        "id": "417121811805999"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "bncvvkjbncvlknbcv",
        "created_time": "2015-09-12T18:54:58+0000",
        "id": "417121718472675"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "nbkjncvvknbc",
        "created_time": "2015-09-12T18:54:57+0000",
        "id": "417121691806011"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "nlcvknbcvnb",
        "created_time": "2015-09-12T18:54:56+0000",
        "id": "417121688472678"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "nkcjbnknb",
        "created_time": "2015-09-12T18:54:55+0000",
        "id": "417121685139345"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "nbkjncvkjn",
        "created_time": "2015-09-12T18:54:54+0000",
        "id": "417121678472679"
      },
      {
        "from": {
          "name": "Rajveer Singh",
          "id": "824840727631444"
        },
        "message": "nbkjncknb",
        "created_time": "2015-09-12T18:54:50+0000",
        "id": "417121665139347"
      }
    ],
    "paging": {
      "cursors": {
        "after": "WTI5dGJXVnVkRjlqZFhKemIzSTZOREUzTVRJeE5qWTFNVE01TXpRM09qRTBOREl3T0RRd09UQT0=",
        "before": "WTI5dGJXVnVkRjlqZFhKemIzSTZOREUzTXpBM09UWTRORFUwTURVd09qRTBOREl4TkRZNU9UQT0="
      },
      "next": "nextUrl"
    },
    "summary": {
      "order": "reverse_chronological",
      "total_count": 76,
      "can_comment": true
    }
  }
}

我的问题是虽然我在一次通话中收到所有评论和回复,但我无法区分两者。此外,它没有提供有关给定评论或回复的喜欢的任何信息。

如何获取这些其他信息?

1 个答案:

答案 0 :(得分:1)

使用仅在评论为回复时才出现的parent字段。