facebookfacebook-graph-apifacebook-javascript-sdkfacebook-live-api

Get real-time comments from videos live Facebook-live-api


I'm setting up an endpoint to receive real-time comments from the live streaming video, I follow the steps in this document smoothly: https://developers.facebook.com/docs/graph-api/server-sent-events/endpoints/live-comments/.

There was one person who commented directly on my live streaming video twice, and I also got those 2 comments, but that person's "id" in 2 comments is different. Can anybody explain me on this, and is there any way to fix it.

var source = new EventSource(
'https://streaming-graph.facebook.com/{live-video-id}/live_comments?access_token={access_token}&comment_rate=one_per_two_seconds&fields=from{name,id},message');

source.onmessage = function(event) {
  console.log(event.data);
};

response 1: { "from": { name: "Joe Commenter", "id": 126577551217199 },"message": "I like it!" }

response 2: { "from": { name: "Joe Commenter", "id": 23567175551752 },"message": "Great photo!" }


Solution

  • They're two different accounts, probably a bot building a profile to be used for spam later.