Created
November 24, 2011 20:32
-
-
Save johl/1392212 to your computer and use it in GitHub Desktop.
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
BITCOIN_EXECUTABLE = '/Applications/Bitcoin.app/Contents/MacOS/bitcoin' and require 'bitcoin' | |
require 'json' | |
require 'rest_client' | |
currency = 'EUR' | |
balance = Bitcoin::Client.getinfo()['balance'] | |
balanceCUR = JSON.parse(RestClient.get "https://mtgox.com/api/0/data/ticker.php?Currency=#{currency}".to_str)['ticker']['avg'] * balance | |
puts "You have #{balance} BTC, which is currently #{balanceCUR} #{currency}." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment