Scheduled facebook posts
how to make Scheduled facebook posts with Facebook api? You can schedule the time with simple PHP script request.Save this PHP file and upload to your server. You can change message text. Facebook receive Unix Time Stamp as a date and time. Datetime will be changed automatically, just set-up date and time as described in example month/day/year hour:minut .
$access_token = "******"; // Facebook access token
$page_id = "******"; // Facebook page ID
date_default_timezone_set('UTC'); // You can set timezone for your country
$datetime = strtotime("05/22/2017 18:11"); // month/day/year hour:minut
$url = "https://graph.facebook.com/$page_id/feed";
$data = array(
'access_token' => $access_token,
'published' => "false",
'message' => "An scheduled post",
'scheduled_publish_time' => $datetime
);
$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, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //to suppress the curl output
$result = curl_exec($ch);
curl_close ($ch);
print_r ($result);
You can change UTC to Current local time or any other +1, +2, -1, etc.. Published parameter must be False.
automated facebook posts
after request submitted, facebook post will be scheduled. You can find all scheduled posts on your Facebook page
https://www.facebook.com/chakabiz
https://www.youtube.com/channel/UCYuMRNb_SRZ4FMsZjnHRZUA
No comments:
Post a Comment