在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