From 42926bee20671537942264aa00648b8ccbd00e58 Mon Sep 17 00:00:00 2001 From: mgp25 Date: Mon, 7 Sep 2015 09:41:24 +0200 Subject: [PATCH] getDiscoversChannelList updated --- src/snapchat.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/snapchat.php b/src/snapchat.php index da54fe6..24db518 100644 --- a/src/snapchat.php +++ b/src/snapchat.php @@ -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() { @@ -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; } /**