我正在尝试在我的Facebook网站墙页面上发布流。

到目前为止,我成功通过我的应用程序页面发布了流,但我不想通过,我想直接发布。

正如我之前说的,我想在我的Facebook网站墙页面上发布,而不是在应用程序墙页面上发布。

我找不到任何有用的东西...如果可能的话,我也想与PHP一起发布。.如果不可能,我想我必须使用JS。无论如何我该怎么做?

有帮助吗?

解决方案

这就是我使用PHP的方式:

 //Note that you will need to have the access token which is what gives permission to write.
 function self_fb_post($to_uid,$acToken) {
    global $fb; //this is the fb object
    $result = false;
    $feed_dir = '/'.$to_uid.'/feed/';  //to the UID you want to send to
    $message_str =  'Why does facebook development not have decent support';
    $msg_body = array('access_token' => $acToken,   
                  'name' => 'My wall post',
                  'message' => $message_str,
                  'caption' => "www.mysite.com",
                  'link' => 'http://www.mysite.com',
                  'description' => 'A wall post which is used to express the frustration of working with crappy facebook developer documentation', 
                  'picture' => 'http://farm6.static.flickr.com/1111/some-pic.jpg',
                  'actions' => array(array('name' => 'My Site',
                              'link' => 'http://www.mysite.com'))
                  );

try {
            //this is the API call that does it all
    $result = $fb->api($feed_dir, 'post', $msg_body);
} 
catch (Exception $e) {       
    $err_str = $e->getMessage();
}


     return $result;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top