在Facebook上评论的回复,我知道如何发布在朋友的墙上的饲料。例如:后使用卷曲PHP /图形API
$url = 'https://graph.facebook.com/' . $fbId . '/feed';
$attachment = array(
'access_token' => $accessToken,
'message' => $msg,
'name' => $name,
'link' => $link,
'description' => $desc,
'picture' => $logo,
);
// set the target url
$ch = curl_init();
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);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$go = curl_exec($ch);
curl_close ($ch);
$go = explode(":", $go);
$go = str_ireplace('"', '', $go[1]);
$go = str_ireplace('}', '', $go);
return $go;
但我想知道,如何发布使用PHP卷曲或Facebook图形API的特殊饲料的答复。有人能帮我解决这个问题吗?
你是对的,这可能会工作。但它使用Facebook PHP API。但我不能使用Facebook API。我想要使用Graph API/cURL的解决方案。而且,仅供参考,我会在'$ go'变量中发布Feed的ID。 – 2011-04-23 04:10:43