Skip to content

Instantly share code, notes, and snippets.

@greenbigfrog
Created September 21, 2016 12:19
Show Gist options
  • Save greenbigfrog/093949e27748d9987e2954821672a211 to your computer and use it in GitHub Desktop.
Save greenbigfrog/093949e27748d9987e2954821672a211 to your computer and use it in GitHub Desktop.
require "http/client"
require "json"
def get(link : String)
res = HTTP::Client.get link
JSON.parse(res.body)
end
response = get "https://api.cryptonator.com/api/full/doge-btc"
# Why does following work:
response["ticker"]["price"].as_s.to_f
# But this doesn't?
response["ticker"]["price"].as_f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment