PHP code example of sky06170 / facebook-fan-page

1. Go to this page and download the library: Download sky06170/facebook-fan-page library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sky06170 / facebook-fan-page example snippets




return [

		'version' => 'v2.12', //your facebook graph api version

		'pageID' => '', //your facebook fan page ID

		'pageToken' => '', //your facebook fan page Token

		'utc' => 8 //Universal Time Coordinated

	];

use Facebook\FanPage\FacebookFanPage;

$options = facebookFanPageOptions();

$pages = new FacebookFanPage($options);

$message = 'test publish';

$response = $pages->publish($message);

use Facebook\FanPage\FacebookFanPage;

$options = facebookFanPageOptions();

$pages = new FacebookFanPage($options);

$postID = isset($_GET['postID']) && !empty($_GET['postID']) ? $_GET['postID'] : '';

$response = $pages->delete($postID);
bash
curl -sS https://getcomposer.org/installer | php