Skip to content

Commit

Permalink
Merge pull request #274 from shibby/master
Browse files Browse the repository at this point in the history
fix getCurrentTopMediasByTagName
  • Loading branch information
raiym authored Feb 20, 2018
2 parents ff67d8f + a3f44b1 commit b4a630a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/InstagramScraper/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,9 @@ public function getCurrentTopMediasByTagName($tagName)
$this->userSession['csrftoken'] = $cookies['csrftoken'];
$jsonResponse = json_decode($response->raw_body, true, 512, JSON_BIGINT_AS_STRING);
$medias = [];
foreach ($jsonResponse['tag']['top_posts']['nodes'] as $mediaArray) {
$medias[] = Media::create($mediaArray);
$nodes = (array) @$jsonResponse['graphql']['hashtag']['edge_hashtag_to_media']['edges'];
foreach ($nodes as $mediaArray) {
$medias[] = Media::create($mediaArray['node']);
}
return $medias;
}
Expand Down

0 comments on commit b4a630a

Please sign in to comment.