H
H
hdtor2016-05-10 12:29:53
PHP
hdtor, 2016-05-10 12:29:53

How to set up automatic FB posting?

I have a company page on Facebook, I connected to the API, I make automatic PHP posts on the pages. But there is a problem, the records are visible only to my accounts, everyone else does not see what the problem is?
I do it with this script:

require_once("facebook/facebook.php"); // set the right path
 
$config = array();
$config['appId'] = '...';
$config['secret'] = '....';
$config['fileUpload'] = false; // optional
$fb = new Facebook($config);
 
$params = array(
  // this is the access token for Fan Page
  "access_token" => "...",
  "message" => "разработка движка трекера",
  "link" => "http://bit-torrent.kiev.ua/index.php",
  "picture" => "http://bit-torrent.kiev.ua/images/satellite/misc/logo.gif",
  "name" => " Проект TBDev - разработка движка трекера",
  "caption" => "http://bit-torrent.kiev.ua/",
  "description" => "test"
);
 
try {
  // 466400200079875 is Facebook id of Fan page https://www.facebook.com/pontikis.net
  $ret = $fb->api('/1587831301541867/feed', 'POST', $params);
  echo 'Successfully posted to Facebook Fan Page';
} catch(Exception $e) {
  echo $e->getMessage();
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
stationfuk, 2016-05-10
@stationfuk

Not strong in the FB API, but the created post is definitely published with the "Public" option? I don't see anything in the code...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question