You are here

function _facebook_pull_notes in Facebook Pull 7.2

Same name and namespace in other branches
  1. 6 facebook_pull.module \_facebook_pull_notes()
  2. 7.3 facebook_pull.module \_facebook_pull_notes()
  3. 7 facebook_pull.module \_facebook_pull_notes()

We need a specific way to access notes, as they are currently not available due to the following bug in the facebook graph.

Http://bugs.developers.facebook.net/show_bug.cgi?id=18266

1 call to _facebook_pull_notes()
_facebook_pull_notes_cached in ./facebook_pull.module
Pull the notes but check the cache first.

File

./facebook_pull.module, line 235
Default cache time.

Code

function _facebook_pull_notes($id, $key, $viewer = 0) {
  $data = array(
    'id' => $id,
    'viewer' => $viewer,
    'key' => $key,
    'format' => 'atom10',
  );
  $qs = http_build_query($data, '', '&');
  $url = 'http://www.facebook.com/feeds/notes.php?' . $qs;
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
  ob_start();
  curl_exec($ch);
  $raw = ob_get_contents();
  ob_end_clean();

  // HBD.
  curl_close($ch);
  return $raw;
}