簡體   English   中英

PHP發布Facebook頁面狀態

[英]PHP post facebook page statuses

$data  = file_get_contents("https://graph.facebook.com/124292684247609/feed?access_token=MY TOKEN");
$data = json_decode($data, true);

print_r($data);

那是我嘗試過的代碼,因為沒有其他代碼可以工作。 但這兩者都沒有,但是仍然沒有給我帶來重大錯誤。 但由於某些原因,它不會發布Facebook帖子。

如何發布Facebook群組狀態/帖子?

編輯:我根本無法使用數組

$data  = file_get_contents("https://graph.facebook.com/(Page-Id)/feed?message=Hello&access_token=MY TOKEN");
$data = json_decode($data, true);

print_r($data);

您可以像這樣輕松發布。

您將需要權限publish_action,manage_pages;

$posts = $data->data;
foreach ($posts as $post) {
    if (isset($post->id)) {
        $post->id;
        $message = (isset($post->message) ? mysql_real_escape_string($post->message) : '');
        echo $post_id.' '.$message;
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM