Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Commit

Permalink
getDiscoversChannelList updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mgp25 committed Sep 7, 2015
1 parent 55fca04 commit 42926be
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/snapchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ public function markStoryViewed($id, $screenshot_count = 0)
* Gets the Discover's channel list
*
* @return array
* An array of channels with all it's information
* An array of channels with its edition_id
*/
public function getDiscoversChannelList()
{
Expand All @@ -2768,9 +2768,18 @@ public function getDiscoversChannelList()
{
return FALSE;
}
$result = parent::get('/discover/channel_list?region=INTERNATIONAL');
$result = json_decode(parent::get('/discover/channel_list?region=INTERNATIONAL'), true);

return $result;
$channels = array();
foreach ($result['channels'] as $channel)
{
$channels[] = array(
'name' => $channel['publisher_formal_name'],
'edition' => $channel['edition_id']
);
}

return $channels;
}

/**
Expand Down

0 comments on commit 42926be

Please sign in to comment.