Last active
January 14, 2016 08:36
-
-
Save e0ipso/6256131 to your computer and use it in GitHub Desktop.
Use FBAutopost wrapper class to publish to a fan page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| try { | |
| $fb = facebook_autopost(); | |
| $fb | |
| ->setDestination($facebook_page_id) | |
| ->publish(array( | |
| 'type' => 'status', | |
| 'params' => array('message' => t('Hello world.')), | |
| )); | |
| } | |
| catch (ErrorException $e) { | |
| drupal_set_message($e->getMessage(), 'error'); | |
| } | |
| ?> |
Can we get response of post as well like exception errors, such as I need Link to Facebook page of the recent gone post. Please suggest!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should call the factory function facebook_autopost() instead of instantiating FBAutopost directly.