我已经创建了一个应用程序,现在我想用新的Graph API在我的一个朋友墙上发布消息。这是否可行?如何使用FB Graph在提要(墙上)上发布消息
我已经在使用oAuth和Graph-api来获取我所有朋友的列表。 在http://developers.facebook.com/docs/api的API告诉我蜷缩https://graph.facebook.com/[userid]/feed阅读饲料,但也告诉我HOWTO发布一条消息:
curl -F 'access_token=[...]' -F 'message=Hello, Arjun. I like this new API.' https://graph.facebook.com/arjun/feed
Ofcourse这不起作用!我不能找出为什么..
这里是我的PHP代码:
require_once 'facebook.php'; // PHP-SDK downloaded from http://github.com/facebook/php-sdk
$facebook = new Facebook(array(appId=>123, secret=>'secret'));
$result = $facebook->api(
'/me/feed/',
array('access_token' => $this->access_token, 'message' => 'Playing around with FB Graph..')
);
此代码不抛出任何错误,我知道我是的access_token正确的(否则我便无法运行$ facebook-> API( '/我=的access_token?' $这个 - >的access_token。);?让我userobject
有没有人在那里sucsessfully发布使用图形的API的消息然后我需要你的帮助!:-)
今天我使用Facebook的:: getLoginUrl()授权的。我已经在“req_perms”下添加了“publish_stream”,但是我认为这还不够好:( – qualbeen 2010-05-07 13:32:53
好吧,如果你被卡住了,你可以看看我最近的博客文章,我已经展示了一个工作示例:http: //bit.ly/cT40vV – 2010-05-07 13:42:32
值得注意的是它应该是“publish_stream”,而不是“stream_publish”。请参阅http://developers.facebook.com/docs/authentication/ – 2010-10-29 20:22:35