且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Facebook页面上发布到墙上(不是个人资料)

更新时间:2023-10-22 22:17:28

github 获取PHP SDK并运行以下代码:

 <?php 
$ attachment = array(
'message'=>'这是我的消息',
'name'=>'这是我的演示Facebook应用程序!',
'caption'=>帖子标题,
'link'=>'http://mylink.com',
'description'=>'这是一个描述',
'picture'=>' http://mysite.com/pic.gif',
'actions'=>数组(
数组(
'name'=>'获取搜索',
'link'= >'http://www.google.com'


);

$ result = $ facebook-> api('/ me / feed /','post',$ attachment);

上面的代码将邮件发送到你的墙上...如果你想发布到您的朋友或其他墙壁,然后用该用户的Facebook用户标识替换。有关更多信息,请查看API文档。


I have a blog site written in php and it posts new blog posts to twitter and a blog ping automatically under the hood using simple http post requests passed using php curl.

I have a facebook page for the blog site and want the updates to be posted to the wall on the page, is there a simple way to do this?

What I really want is a url and set of params to parcel up as an http post request.

Note that this is to post to the wall on a new style page not a profile.

Thanks in advance.

Get PHP SDK from github and run the following code:

<?php
$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'
        )
    )
);

$result = $facebook->api('/me/feed/', 'post', $attachment);

the above code will Post the message on to your wall... and if you want to post onto your friends or others wall then replace me with the Facebook User Id of that user..for further information look out the API Documentation.