Facebook 直接使用 PHP 发布流

发布于 2024-10-21 18:24:35 字数 203 浏览 1 评论 0原文

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

到目前为止,我成功通过我的APP页面发布流,但我不想通过,我想直接发布。

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

我找不到任何有用的东西...如果可能的话我也想用 PHP 发布..如果不可能的话我想我将不得不使用 js。无论如何我该怎么做呢?

I am trying to publish stream on my facebook WEBSITE wall page.

so far I succeeded to publish stream via my APP page but I dont want via, I want to publish directly.

as I said before, I want to publish on my facebook WEBSITE wall page, not on the app wall page.

I couldnt find anything useful... also I want to publish with PHP if thats possible.. if it is not possible than I guess I will have to use js. anyway how can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜是你 2024-10-28 18:24:35

这就是我使用 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;
}

this is how I do it with 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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文