You are here

function fb_graph_post in Drupal for Facebook 7.4

Write to facebook's graph.

3 calls to fb_graph_post()
fb_opengraph_delete_confirm_form_submit in ./fb_opengraph.pages.inc
fb_opengraph_publish_action in ./fb_opengraph.module
Helper function to publish user activity to Facebook's Open Graph.
fb_post_publish_node in ./fb_post.module

File

./fb.module, line 1393

Code

function fb_graph_post($path, $params) {
  if (isset($params['access_token']) && !$params['access_token'] && function_exists('debugger')) {
    debugger();
  }
  if (!isset($params['access_token'])) {
    $params['access_token'] = fb_access_token();
  }
  $url = url("https://graph.facebook.com/{$path}");
  $options = array(
    'method' => 'POST',
    'data' => drupal_http_build_query($params),
  );
  $data = fb_http($url, $options);
  return $data;
}