Set Facebook status using Facebook API?

I would like to know how to set my status using the Facebook and PHP APIs, maybe with the CURL function?

Thank!!

+3
source share
3 answers

Using the new PHP SDK , you can do:

<?php

require './facebook.php';

$fb = new Facebook(array(
  'appId'  => 'YOUR APP ID',
  'secret' => 'YOUR API SECRET',
  'cookie' => true, // enable optional cookie support
));
$post = $fb->api('me/feed', 'POST', array('message' => 'hello world!'));

The various options are described below here .

+2
source

http://developers.facebook.com/docs/api#publishing

curl -F 'access_token=...' \
     -F 'message=Hello, Arjun. I like this new API.' \
     https://graph.facebook.com/arjun/feed
+2
source

, :

, .

Again, copying and pasting from the documentation on Facebook does not provide an example, because their documentation is not as good as it should be, in other words, it is hopeless and a prerequisite for many things.

Also thank you Duck.

The solution may be similar to the message above:

$result = $facebook->api(
    '/me/feed/',
    'post',
    array('access_token' => $this->access_token, 'message' => 'Playing around with FB Graph..')
);
0
source

Source: https://habr.com/ru/post/1752163/


All Articles