You are here

public static function ShareaholicUtilities::clear_fb_opengraph in Share Buttons, Related Posts, Content Analytics - Shareaholic 7.3

Same name and namespace in other branches
  1. 8 utilities.php \ShareaholicUtilities::clear_fb_opengraph()

Clears Facebook Open Graph cache for provided node

Parameters

Object $node:

File

./utilities.php, line 686

Class

ShareaholicUtilities

Code

public static function clear_fb_opengraph($node) {
  if ($node->status !== NODE_PUBLISHED) {
    return;
  }
  $page_link = url('node/' . $node->nid, array(
    'absolute' => TRUE,
  ));
  if (isset($page_link)) {
    $fb_graph_url = "https://graph.facebook.com/?id=" . urlencode($page_link) . "&scrape=true";
    $options = array(
      'method' => 'POST',
      'timeout' => 5,
    );
    $result = drupal_http_request($fb_graph_url, $options);
  }
}