如何在facebook活动墙上发帖?

时间:2011-04-15 10:05:33

标签: php facebook

我是facebook app开发的新手,我正试图在活动墙上自动发帖。我已阅读,其中包括要在特定墙上发布的ID。我试过了,但它不起作用。

我认为也许它可以用于“to”(一个特定的目标墙),但我不知道它的语法......

任何人都可以帮忙吗?或者至少给出一个包含“to”属性的post语法示例... plssss ...

2 个答案:

答案 0 :(得分:3)

$attachment = array(
                'message' => 'this is my message',
                'name' => 'This is my demo Facebook application!',
                'caption' => "Caption of the Post",
                'link' => 'http://mylink.com',
                'description' => 'this is a description',
                'picture' => 'http://mysite.com/pic.gif',
                'actions' => array(array('name' => 'Get Search',
                'link' => 'http://www.google.com'))
                );
$uid = ""; //friend id OR "me"
$result = $facebook->api('/'.$uid.'/feed/','post',$attachment);

  

注意:您应该让用户publish_stream extended permission,并且您应该加载SDK Lib

答案 1 :(得分:0)

$attachment = array(
                'message' => 'this is my message'
                );
$eid = ""; //event id
$result = $facebook->api('/'.$eid.'/feed/','post',$attachment);

http://developers.facebook.com/docs/reference/api/event/< - 事件对象文档

https://api.facebook.com/method/stream.publish?message=<your_message>&target_id=<event_id>&access_token=<your_token>