Skip to content

Commit

Permalink
process both tag structures
Browse files Browse the repository at this point in the history
  • Loading branch information
kringkaste committed Jun 11, 2021
1 parent d847f83 commit b5c96d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Instagram Feed Changelog

## 1.1.4 - 2021-06-11

### Fixed
- In some cases, you get the old tag structure. So we accept both now.

## 1.1.3 - 2021-06-09

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "codemonauts/craft-instagram-feed",
"description": "Craft CMS plugin to receive Instragram feed data as variable in templates.",
"version": "1.1.3",
"version": "1.1.4",
"type": "craft-plugin",
"keywords": [
"craft",
Expand Down
4 changes: 4 additions & 0 deletions src/services/InstagramService.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ private function getInstagramTagData(string $tag): array
return [];
}

if (isset($obj['entry_data']['TagPage'][0]['graphql'])){
return $this->flattenMediaArray($obj['entry_data']['TagPage'][0]['graphql']['hashtag']['edge_hashtag_to_media']['edges'], self::STRUCTURE_VERSION_1);
}

return $this->flattenMediaArray($obj['entry_data']['TagPage'][0]['data']['recent']['sections'], self::STRUCTURE_VERSION_2);
}

Expand Down

0 comments on commit b5c96d5

Please sign in to comment.