Skip to content

Instantly share code, notes, and snippets.

@greenbigfrog
Created September 21, 2016 12:19
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