You are here

protected function Instagram::parse_response in Drupagram 7

Same name and namespace in other branches
  1. 6 drupagram.lib.php \Instagram::parse_response()
1 call to Instagram::parse_response()
Instagram::call in ./drupagram.lib.php
Method for calling any drupagram api resource

File

./drupagram.lib.php, line 417
Classes to implement the full Instagram API

Class

Instagram
Primary Instagram API implementation class Supports the full REST API for drupagram.

Code

protected function parse_response($response, $format = NULL) {
  if (empty($format)) {
    $format = $this->format;
  }
  switch ($format) {
    case 'json':

      // http://drupal.org/node/985544 - json_decode large integer issue
      // $length = strlen(PHP_INT_MAX);
      // $response = preg_replace('/"(id|in_reply_to_status_id)":(\d{' . $length . ',})/', '"\1":"\2"', $response);
      return json_decode($response, TRUE);
  }
}