Top Level Namespace
Instance Method Summary collapse
Instance Method Details
#bit_price ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/bit_price.rb', line 4 def bit_price page = Nokogiri::HTML(open("https://coinbase.com/charts")) prices = page.css("div.page-header h2.pull-right strong").text.split("$").reject(&:empty?) puts puts "The Current Bitcoin Prices Are:" puts "Buy Price: $#{prices[0]}" puts "Sell Price: $#{prices [1]}" puts puts "Prices provided by www.coinbase.com/charts" end |