Ejemplo n.º 1
0
        public async Task <AudioBurstResponse> Search(string searchTerm)
        {
            string     apiURL = $"http://sapi.audioburst.com/search/site?appKey={appKey}&device=mobile&user=gal&value={searchTerm}";
            HttpClient hc     = new HttpClient();
            //hc.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", apiKey);
            string json = await hc.GetStringAsync(apiURL);

            hc.Dispose();
            AudioBurstResponse playlistData = JsonConvert.DeserializeObject <AudioBurstResponse>(json);

            return(playlistData);
        }
Ejemplo n.º 2
0
        public async Task <AudioBurstResponse> GetPlaylistBurstsAsync(int playlistId)
        {
            string apiURL = $"https://sapi.audioburst.com/v2/topstories/category?appkey={appKey}&device=mobile&category={playlistId}";

            if (playlistId == 0)
            {
                apiURL = $"https://sapi.audioburst.com/v2/topstories?appkey={appKey}&device=mobile";
            }
            HttpClient hc = new HttpClient();
            //hc.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", apiKey);
            string json = await hc.GetStringAsync(apiURL);

            hc.Dispose();
            AudioBurstResponse playlistData = JsonConvert.DeserializeObject <AudioBurstResponse>(json);

            return(playlistData);
        }