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"
精彩评论