使用PHP 發佈到Facebook 粉絲頁:綜合指南
簡介:
直接將🎜>簡介:
直接將🎜>簡介:
造訪https://developers.facebook.com/tools/explorer/ 並選擇您的應用程式. 授予存取您的 Facebook 帳號的權限。
$page_access_token = 'XXXXXXX'; $page_id = 'YYYYYYYY';
$data['picture'] = "http://www.example.com/image.jpg"; $data['link'] = "http://www.example.com/"; $data['message'] = "Your message"; $data['caption'] = "Caption"; $data['description'] = "Description";
$data['access_token'] = $page_access_token;
$post_url = 'https://graph.facebook.com/'.$page_id.'/feed';
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $return = curl_exec($ch); curl_close($ch);
以上是如何使用 PHP 將內容發佈到我的 Facebook 粉絲頁?的詳細內容。更多資訊請關注PHP中文網其他相關文章!