我已經創建了一個應用程序,現在我想用新的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