Skip to content

Instantly share code, notes, and snippets.

@atomicscope
Created September 4, 2018 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomicscope/e72c8d8d934a2f81e4cff0c2f9f55f2c to your computer and use it in GitHub Desktop.
Save atomicscope/e72c8d8d934a2f81e4cff0c2f9f55f2c to your computer and use it in GitHub Desktop.
var client = new HttpClient()
client.BaseAddress = new Uri("https://api.coindesk.com/v1/bpi/currentprice.json");
var result = await client.GetAsync("");
var resultContent = await result.Content. ReadAsAsync<JObject>().Result;
var token = resultContent["bpi"]["USD"]["rate_float"];
var price = (int)token;
if (price > 6000) {
log.Info(“Price is higher than the threshold value” + price);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment