Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use FBAutopost wrapper class to publish to a fan page.
<?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');
}
?>
@drasgardian

This should call the factory function facebook_autopost() instead of instantiating FBAutopost directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.