如何通过Facebook Graph API发布YouTube视频链接

问题描述:

具体来说,我正在寻找的是嵌入式视频播放器功能,如果您只是手动分享YouTube视频,但是通过Graph API以编程方式完成。

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.

您似乎必须自己提取页面中的实际swf的URL和缩略图。

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

例如,这似乎起作用:

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

查看来源:使用Facebook发布嵌入式视频链接Graph API