You are here

public function InstagramRequest::get_instagram_posts in Instagram Block 7

Get an array of InstagramPosts objects.

File

./instagram_block.lib.php, line 140
Instagram classes to integrate with the Instagram API.

Class

InstagramRequest
@file Instagram classes to integrate with the Instagram API.

Code

public function get_instagram_posts() {
  $response = $this
    ->parse_response($this->response);

  // Check on successfull call
  if ($response) {
    $posts = array();
    foreach ($response->data as $post) {
      $posts[] = new InstagramPost($post);
    }
    return $posts;
  }
  else {
    return array();
  }
}