I am using Facebook Live inside of a web app to live stream videos. I am wondering if it is possible to include the live commenting associated with the video on my site in real time. I know I can grab the comments from the graph API, however this is not real time. The comment embed widget is also not real time and would need to be constantly refreshed.
The documentation says :
"You can read live video comments by polling the Live Video
Comments
edge."
What is polling? How do I do this and is it possible from a front end web app.
Basically my question is how do I include the live comments along with Facebook Live video on my own website.
This is now available via SSE streams
https://developers.facebook.com/docs/graph-api/server-sent-events/endpoints/live-comments
I know I can grab the comments from the graph API, however this is not real time.
This is as real time as it can get. If someone posts a comment and you immediately query the Graph API, you will see their comment.
What is polling?
As there is currently no streaming data endpoint for comments, you must query the comments on the live video repeatedly. That is, every 2 seconds or so, refresh the data.
This is done by making a Graph API GET request for /{video-id}/comments. I also suggest setting "order": "reverse_chronological" in the parameters so that you get the newest comments first.
You can see some sample code for doing this as part of the Live Comments Teleprompter: https://github.com/fbsamples/live-comments-teleprompter/blob/master/js/main.js#L89-L103
Related
I am trying to know how get just the live video stream from a facebook page. In my case, I want to build an app to my church and I need just their live stream. On their facebook page are a lot of videos that was streamed, but I'm not interested that, I want just their live stream.
Problem: I don't know when they start streaming and I don't know how get it, I'd like to have just the streaming video that they start streaming.
Someon can help me with that?
IIRC you also asked this question in the FB Dev group and added the info that you do not have access to those pages. W/o access to them or having admin users granting your app access to them you cannot retrieve notifications/callbacks whenever a broadcast starts. Even when just polling them (using the endpoint CBroe mentioned) you need a page access token to do so.
I want to know if I can access a user's play history (more specifically what songs they listen to the most) for an app. The app I am building can perform the same goal with iTunes using their built-in play counter. I know Spotify uses a similar counter, but I assume for privacy concerns they don't want to deal with privacy concerns from concerned users. However, I saw a few instances where it was suggested that this task could be accomplished using Facebook's API, or Echo Nest's API. Please let me know if anyone has some constructive suggestions toward finding a way to legally obtain a particular users 'most listened to songs', or something to that effect.
SB
There's some documentation about Open Graph Music on the Facebook Developer homepage:
https://developers.facebook.com/docs/opengraph/music/
Baseline is that you only can request a User's play history if he gave you app the explicit right to read his data.
The relevant permissions would be
user_actions.music https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference-user_actions_music
user_actions:{app_namespace} https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference-user_actions__app_namespace_
Then, you should be able to request
GET /me/music.listens
according to https://developers.facebook.com/docs/reference/opengraph/action-type/music.listens/ You'll need to perform the aggregation of the most played songs/artists yourself, because there's no endpoint for that.
when I using facebook graph api explorer for feed and home data,it always gives old result.
Generally me/home gives recent friends activity which show as like as when facebook.com open and feed gives if someone tag me,or comment my status releted to me.but when I compare with my feed wall with data given by grap api me/feed or me/home its show that graph api response is not updated. I can't use real time update its only because real time update does not support native desktop application.
so is there any other way to get recent update of recent activites except me/home and me/feed method?
I think you should consider using real time update. The fact that it doesn't support native desktop application isn't a real problem. It just means that you have to do some alternations in your application.
I don't know what OS you are using or what programming language you are using, but I think it's rather safe to say that your toolbox when it comes to your technologies can support calls to a web server or a web service.
Then you should use the web server or web service to implement the real time update specifications given by Facebook.
Alternative, you call poll Facebook API on a regular basis but I would not recommend it.
Use real time update and check your web server for new messages. This solution is working quite good. I have received updates from Facebook within 10 seconds after they have been posted.
If you don't want to poll your web server, try to implement it using web sockets (HTML5), perhaps in combination with node.js.
I am currently developing a new website / facebook app for an online magic competition. I am hoping most of the functionality can come from Facebook's own services, and would like your feedback on how plausible our goals are.
Essentially there will be two types of users: magicians and voters. Magicians will upload a video of them performing a trick (or select a video they have already uploaded). Voters will vote for their favourite magicians, and be able to post these videos to their wall.
Are these possible:
Video upload to Facebook - I have had a search, but the only method I found uses the depreciated REST API. Is there a newer implementation?
Video download - After a user has uploaded a video are they (or can we) able to download their video from Facebook?
Embedding magicians Facebook videos on the standalone website?
Thank you in advance
You can still upload videos and photos using the graph api. We have done this into galleries for a number of clients.
see here for a picture example (works with other media objects such as videos):
Is it possible to post a status update and adding an image file with facebook graph API?
The problems you may face though are the issues of managing and approving content in the site.
One solution we have found is to combine YouTube API and Facebook to get the best of both worlds. you can now embed a YouTube uploader in your site / app which will post videos into a channel of yours but have an approval app to control what lands. Then add any voting mechanism of your choice to the stream of videos. You can use YouTube likes, Facebook likes or your own. Take a look at this video:
http://www.youtube.com/watch?v=u1zgFlCw8Aw
You can embed a YouTube channel into Facebook easily too:
http://www.youtube.com/watch?v=pClpKAnddGI
Also using youtube, you can spread your net farther to reach more of an audience.
Hope this can be of some help. (No, I don't work for YouTube just find using more than one platform better)
I was working on an iphone app where users create images (think like a paint program); then they have an option to post it to Facebook: the image would be uploaded to the users albums and simultaneously a post would appear on their stream ("Hey, look what I just made with app X, get it here; etc).
This used to work just dandy, but it seems that Facebook no longer allows images hosted on their domain to be used in stream posts: FBCDN image is not allowed in stream is the error message.
Anyone have a workaround method for doing this kind of "upload and stream post in one shot" kind of thing? I know I could have the users upload all their created images to my own server and use that in the feed post...but that should be totally unnecessary. It shouldn't require an extra server for a user to draw a picture in a paint app and then upload to FB with a corresponding feed post about it.
Thanks!
I posted a similar question and learned that it's now a 2-step process where you upload the image to an album, then include a link to that in the feed. The answer is complicated, so please check over at that link. If you find it helpful, please up-vote that answer. (Feel free to up-vote/accept this one, too, but I understand that's sort of cheating ;)