Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Use FBAutopost wrapper class to publish to a fan page.

View gist:6256131
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?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');
}
?>

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.