我可以使用API按照Simple example to post to a Facebook fan page via PHP?上的示例发布到我的Facebook,如下所示
$data['picture'] = $image_URL;
$data['link'] = $link_URL;
$data['message'] = $message_TEXT;
$data['caption'] = $caption_TEXT;
$data['description'] = $description_TEXT;
$data['access_token'] = $page_access_token;
$post_url = 'https://graph.facebook.com/'.$page_id.'/feed';
try{
$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);
}catch (Exception $e) {
echo 'ERROR '.$e.' in CURL for Facebook posting';
}
如果我们知道帖子的网址(例如https://www.facebook.com/TED/posts/10159368542595652)
,是否可以做类似的事情来分享帖子