2010-09-22 93 views

回答

0

您可以使用旧的REST API或新的Graph API。无论哪种情况,您都必须拥有publish_stream权限。

如果你想使用的图形API,你需要创建一个Post对象,然后将其上传到图形供稿网址为该配置

graph.facebook.com/PROFILE_ID/feed

您需要将Post对象中的属性设置为视频的youTube url。

http://developers.facebook.com/docs/reference/api/post/

如果你想使用旧的REST API的过程是相似的,但你邮寄到

api-video.facebook.com/restserver.php

2

看起来您必须自己提取页面中实际的swf和缩略图图像的URL。

例如,这似乎工作:

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 

见来源:Posting an embedded video link using the Facebook Graph API

相关问题