3

Facebook の WEBSITE ウォール ページにストリームを公開しようとしています。

これまでのところ、APP ページを介してストリームを公開することに成功しましたが、経由したくないので、直接公開したいと考えています。

前に言ったように、アプリのウォール ページではなく、Facebook の WEBSITE ウォール ページに公開したいと考えています。

有用なものが見つかりませんでした...また、可能であればPHPで公開したいと思います..それが不可能な場合は、jsを使用する必要があると思います. とにかくどうすればそれを行うことができますか?

4

1 に答える 1

5

これは私が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;
}
于 2011-03-14T20:04:11.000 に答える