Skip to content

Commit

Permalink
Merge pull request #248 from rhcarlosweb/develop
Browse files Browse the repository at this point in the history
Square thumbnails URL
  • Loading branch information
raiym authored Jan 9, 2018
2 parents 3ba9912 + 5edd873 commit 3ed2014
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/InstagramScraper/Model/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ class Media extends AbstractModel
*/
protected $imageHighResolutionUrl = '';

/**
* @var array
*/
protected $squareThumbnailsUrl = [];

/**
* @var array
*/
Expand Down Expand Up @@ -248,6 +253,15 @@ public function getImageHighResolutionUrl()
return $this->imageHighResolutionUrl;
}


/**
* @return array
*/
public function getSquareThumbnailsUrl() {
return $this->squareThumbnailsUrl;
}


/**
* @return array
*/
Expand Down Expand Up @@ -388,6 +402,13 @@ protected function initPropertiesCustom($value, $prop, $arr)
$this->imageStandardResolutionUrl = $images['standard'];
$this->imageHighResolutionUrl = $images['high'];
break;
case 'thumbnail_resources':
$thumbnailsUrl = [];
foreach( $value as $thumbnail ) {
$thumbnailsUrl[] = $thumbnail['src'];
}
$this->squareThumbnailsUrl = $thumbnailsUrl;
break;
case 'carousel_media':
$this->type = self::TYPE_CAROUSEL;
$this->carouselMedia = [];
Expand Down

0 comments on commit 3ed2014

Please sign in to comment.