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

Commit 42926be

Browse files
committed
getDiscoversChannelList updated
1 parent 55fca04 commit 42926be

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/snapchat.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,7 @@ public function markStoryViewed($id, $screenshot_count = 0)
27592759
* Gets the Discover's channel list
27602760
*
27612761
* @return array
2762-
* An array of channels with all it's information
2762+
* An array of channels with its edition_id
27632763
*/
27642764
public function getDiscoversChannelList()
27652765
{
@@ -2768,9 +2768,18 @@ public function getDiscoversChannelList()
27682768
{
27692769
return FALSE;
27702770
}
2771-
$result = parent::get('/discover/channel_list?region=INTERNATIONAL');
2771+
$result = json_decode(parent::get('/discover/channel_list?region=INTERNATIONAL'), true);
27722772

2773-
return $result;
2773+
$channels = array();
2774+
foreach ($result['channels'] as $channel)
2775+
{
2776+
$channels[] = array(
2777+
'name' => $channel['publisher_formal_name'],
2778+
'edition' => $channel['edition_id']
2779+
);
2780+
}
2781+
2782+
return $channels;
27742783
}
27752784

27762785
/**

0 commit comments

Comments
 (0)