Warm tip: This article is reproduced from stackoverflow.com, please click
facebook facebook-graph-api facebook-javascript-sdk facebook-live-api

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

发布于 2020-04-23 11:24:13

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!" }

Questioner
colinmorgan
Viewed
163
Brad 2020-02-08 07:01

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