Created
May 31, 2015 23:05
-
-
Save jerzygangi/76714b9ca7e28ea525fc to your computer and use it in GitHub Desktop.
How to get the current Bitcoin price from a JSON API
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 "rubygems" | |
require "json" | |
require "net/http" | |
response = Net::HTTP.get_response(URI.parse("https://api.bitcoinaverage.com/exchanges/USD")) | |
parsed_response = JSON.parse(response.body) | |
puts parsed_response["bitex"]["rates"]["last"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment