开发者

How to post on directly users wall in Facebook

I use this to post on users wall, but it shows a blank page, and the开发者_如何学C post doesn't appear on my wall :

$url = "https://graph.facebook.com/user_id/feed";
$ch = curl_init();
$attachment =  array(   'access_token'  => access_token_here,                        
                    'name'          => "Rave Kenya",
                    'link'          => "www.youtube.com",
                    'description'   => 'Testing a new facebook app',
                    'message' => 'Tested',

                );

curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $attachment);
$result =curl_exec($ch);


Why reinvent the wheel and not use facebook php library?

And a step-by-step instructions are available at "5 Steps to publish on a facebook wall using php"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜