This section of code uses the HTTParty gem to query the bitcoin blockchain using the Blockchain.info API.
I had a lot of fun working with this gem, and I'm looking forward to working with other APIs in the future!
I would also like to find a way to use the Blockchain.info to calculate the total transcation fees associated with
an individual bitcoin addres.
begin
@response = HTTParty.get('https://blockchain.info/address/'[email protected]+'?format=json')
@BTC = @response.parsed_response['final_balance']/100000000.0
@total_received = @response.parsed_response['total_received']/100000000.0
@total_sent = @response.parsed_response['total_sent']/100000000.0
#@total_fees = .each +=
rescue
@BTC = "Invalid Address"