From 5edd873dee0f495b2755ff35a2c658cf855a0a83 Mon Sep 17 00:00:00 2001 From: Rhuan Carlos Date: Sun, 24 Dec 2017 09:31:02 -0200 Subject: [PATCH] Square thumbnails URL --- src/InstagramScraper/Model/Media.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/InstagramScraper/Model/Media.php b/src/InstagramScraper/Model/Media.php index 5abb832e..60fbd2ca 100644 --- a/src/InstagramScraper/Model/Media.php +++ b/src/InstagramScraper/Model/Media.php @@ -60,6 +60,11 @@ class Media extends AbstractModel */ protected $imageHighResolutionUrl = ''; + /** + * @var array + */ + protected $squareThumbnailsUrl = []; + /** * @var array */ @@ -248,6 +253,15 @@ public function getImageHighResolutionUrl() return $this->imageHighResolutionUrl; } + + /** + * @return array + */ + public function getSquareThumbnailsUrl() { + return $this->squareThumbnailsUrl; + } + + /** * @return array */ @@ -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 = [];