开发者

How to post on directly users wall in Facebook

开发者 https://www.devze.com 2023-02-17 08:13 出处:网络
I use this to post on users wall, but it shows a blank page, and the开发者_如何学C post doesn\'t appear on my wall :

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

精彩评论

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

关注公众号