Exemple #1
0
        internal async static Task GetCoinStats(String crypto)
        {
            String URL = "https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=" + crypto + "&tsym=" + coin;

            Uri                 requestUri   = new Uri(URL);
            HttpClient          httpClient   = new HttpClient();
            HttpResponseMessage httpResponse = new HttpResponseMessage();

            string response = "";

            try {
                httpResponse = await httpClient.GetAsync(requestUri);

                httpResponse.EnsureSuccessStatusCode();

                response = await httpResponse.Content.ReadAsStringAsync();

                var data = JToken.Parse(response);

                stats = PricePoint.GetPricePointStats(data["Data"]["AggregatedData"]);
            } catch (Exception ex) {
                var dontWait = await new MessageDialog(ex.Message).ShowAsync();
            }
        }