Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to post an YouTube Video link through Facebook Graph API

Tags:

facebook

Specifically what I'm looking for is the embedded video player functionality you would receive if you had just manually shared a YouTube video but done programmatically through the Graph API.

like image 715
Eric Clifford Avatar asked Nov 14 '22 07:11

Eric Clifford


1 Answers

It appears that you have to extract the URLs of the actual swf in the page and the thumbnail image yourself.

For example, this seems to work:

curl -F 'access_token=...' \
     -F 'message=Link to YouTube' \
     -F 'link=http://www.youtube.com/watch?v=3aICB2mUu2k' \
     -F 'source=http://www.youtube.com/v/3aICB2mUu2k' \
     -F 'picture=http://img.youtube.com/vi/3aICB2mUu2k/0.jpg' \
     https://graph.facebook.com/me/feed

See source: Posting an embedded video link using the Facebook Graph API

like image 114
Somnath Muluk Avatar answered Dec 10 '22 14:12

Somnath Muluk