From 4a43cabbecc7b21828ffed0379cd40e0de7a6ade Mon Sep 17 00:00:00 2001 From: esmazguhin Date: Tue, 9 Jan 2018 11:19:42 +0500 Subject: [PATCH] Update getPaginateMediasByTag --- src/InstagramScraper/Instagram.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/InstagramScraper/Instagram.php b/src/InstagramScraper/Instagram.php index 8448b6b4..7b7af811 100644 --- a/src/InstagramScraper/Instagram.php +++ b/src/InstagramScraper/Instagram.php @@ -647,23 +647,23 @@ public function getPaginateMediasByTag($tag, $maxId = '') throw new InstagramException('Response decoding failed. Returned data corrupted or this library outdated. Please report issue'); } - if (empty($arr['tag']['media']['count'])) { + if (empty($arr['graphql']['hashtag']['edge_hashtag_to_media']['count'])) { return $toReturn; } - $nodes = $arr['tag']['media']['nodes']; + $nodes = $arr['graphql']['hashtag']['edge_hashtag_to_media']['edges']; if (empty($nodes)) { return $toReturn; } foreach ($nodes as $mediaArray) { - $medias[] = Media::create($mediaArray); + $medias[] = Media::create($mediaArray['node']); } - $maxId = $arr['tag']['media']['page_info']['end_cursor']; - $hasNextPage = $arr['tag']['media']['page_info']['has_next_page']; - $count = $arr['tag']['media']['count']; + $maxId = $arr['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['end_cursor']; + $hasNextPage = $arr['graphql']['hashtag']['edge_hashtag_to_media']['page_info']['has_next_page']; + $count = $arr['graphql']['hashtag']['edge_hashtag_to_media']['count']; $toReturn = [ 'medias' => $medias,