You are here

protected function Twitter::parse_response in Twitter 7.5

Same name and namespace in other branches
  1. 6.5 twitter.lib.php \Twitter::parse_response()
  2. 6.3 twitter.lib.php \Twitter::parse_response()
  3. 7.6 twitter.lib.php \Twitter::parse_response()
  4. 7.3 twitter.lib.php \Twitter::parse_response()

See also

https://www.drupal.org/node/985544

2 calls to Twitter::parse_response()
Twitter::getParsedResponse in ./twitter.lib.php
Retrieves the parsed response of the Twitter API endpoint call.
Twitter::request in ./twitter.lib.php
Performs a request.

File

./twitter.lib.php, line 211
Integration layer to communicate with the Twitter REST API 1.1. https://dev.twitter.com/docs/api/1.1

Class

Twitter
Primary Twitter API implementation class

Code

protected function parse_response($response) {
  $length = strlen(PHP_INT_MAX);
  $response = preg_replace('/"(id|in_reply_to_status_id|in_reply_to_user_id)":(\\d{' . $length . ',})/', '"\\1":"\\2"', $response);
  return json_decode($response, TRUE);
}