/question.cr Secret
Created
September 21, 2016 12:19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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