How can I download a video from Facebook using GraphAPI? - facebook

I want to download a video from facebook to the clients local drive. I saw a few browser plugins and Facebook apps that are able to that and I was wondering how it can be done using the GraphAPI or in any other way.

First, you get the Graph API object. If the object is public, it's simple, just get https://graph.facebook.com/10151651550011063. (Where the number is the object's ID, equal to the ?v=OBJECTID in the facebook video URL.)
If the object is not public, you need a valid access_token, and the Graph API url becomes something like https://graph.facebook.com/10151651550011063?access_token=DFSDSGSFDGFGDSblabla
Then, in the Graph API object, you'll find the video download link under source.

Refer Below Link. Might help you
http://developers.facebook.com/docs/reference/api/video/

1/ You can get source video by api but it only in sd quality.
2/ If you need to get source video by api, make sure you know to get accesstoken by this way:
Go to https://m.facebook.com/composer/ocelot/async_loader/?publisher=feed
Search for EAAA... it is your accesstoken.
3/ https://graph.facebook.com/v10.0/(page/group/userid)_videoid?fields=source&access_token=your_accesstoken
example https://graph.facebook.com/v10.0/1389311341281276_2668264723385925?fields=source&access_token=your_accesstoken
finally you can get private video or public video from facebook by graph api

$idPage/feed?fields=message,link,created_time,type,name,id,source
source => will return url mp4 video post

You cannot download videos using api.
You can just get there links,likes,comments etc.

Related

Upload a video to Facebook Graph API, and tag a place

I'm trying to "attach" a page to an uploaded video (via graph api) on Facebook, without any luck.
Creating a post (via /feed endpoint) and tagging on a place is working. Sharing a picture and tagging on a place is working. But not videos.
As I've seen in the official docummentation, the flow to "attach" a page is to use resumable uploads and then update the video via POST /<video_id> with { place: <page_id> }. But it's not working at all, besides the fact the API is returning { success: true }
I've also tried other alternatives:
Upload the video at once (not resumable).
Just specify the video url (not even getting the <video_id>).
Doing the POST /<video_id> update request via their Graph API explorer console.
I'm using version 2.8, the graph-video endpoint and have publish_actions permissions.
What could I be doing wrong? How do you do this?
Thanks.
I couldn't find any way to do this via the Graph Video api. The final solution for me was to create a feed post, via /me/feed specifying:
{
place: pageId,
coordinates: '{latitude,longitude}'
link: 'url'
}
being link an url pointing to a website that have the proper Open Graph attributes.

Unity facebook SDK, can not post picture with FB.Feed

In my Unity IOS game, I am unsuccessfully trying to use FB.Feed to share a screenshot on the user's wall.
Facebook documentation uses FB.Api to publish the screenshot, but this method does not display a share dialog, it simply uploads the pic to Facebook.
Answers I have found so far:
Upload the picture using FB.Api, and then parse the FBResult for the picture URL, and feed that to FB.Feed Link to answer.
This method triggers an error, since it is not possible to use a Facebook URL as source for a picture.
Save the picture locally and prepend "File://" to the picture path. Link to question. This does not seem to work either, and the Facebook documentation does not seem to have any information on URL formatting.
My question:
Is this the correct (and only) way to display a share dialog when publishing a picture? Or am I looking in the wrong direction?
FB.Feed only allows you to post link to images. It doesn't upload the images to Facebook. Therefore, these images need to hosted somewhere on the net and not locally.
The best way to make it work is either upload the images to FB (with privacy property set to EVERYONE) using FB.API, and then share the link to that picture via FB.Feed. If you don't want to create duplicate stories, i.e. one from posting the picture and another from FB.Feed, make sure that you set no_story to true.

Posting an image to foursquare by URL?

Looking through the Foursquare documentation I found the Photo Add section.
In APIs for other social platforms I have been able to post an image by its source url, e.g.: https://www.google.com/images/srpr/logo3w.png (e.g. this is possible on Facebook & Tumblr)
The documentation is a little unclear about the capabilities of the post* developer preview argument.
Is it possible to "upload" an image by its source url to Foursquare?
(otherwise can I get this added to the feature request queue?!)
It is not currently possible to upload an image by url. You will need to upload the image data with your photos/add request.

Facebook Phot uploading PHPSDK

uploading photos to a wall, i can use the items below, I am using the solution on this: Facebook graph API & PHP SDK questions
What I need to know is checking for its location once its uploaded... will that be stored in $fb_foto as shown in the link above...
Cheers
Phil
In that example $fb_foto will contain the photo ID after upload, you can then access it at /{photo id} in the Graph API

Posting images/emotions to Facebook status

I am trying to post images/emotions to a users status. Here is an app that does it: http://apps.facebook.com/status-emoticon/
I've viewed the JS source and I'm cofused, it seems to be sending some sort of code as a message and facebook is turning that code into an image.
Any ideas?
When you upload an image to FB you have to encode it in the body of your HTTP request. I did something like this recently when messing around with the API, check out this project:
https://github.com/abrady/gappengine/tree/master/fb06_canvas
It is a canvas that lets you grab photos from your friend's albums and upload them into an album of your choice. (in particular, look at the function graph_put_file in fb06_canvas.py)