Skip to content

Instantly share code, notes, and snippets.

@nicolasleander
Last active June 11, 2017 21:55
Show Gist options
  • Save nicolasleander/603a471f9399631e59065dd2315fb0e8 to your computer and use it in GitHub Desktop.
Save nicolasleander/603a471f9399631e59065dd2315fb0e8 to your computer and use it in GitHub Desktop.
ruby -e'require"json";require"net/http";loop{j=JSON.parse(Net::HTTP.get(URI("http://api.coinmarketcap.com/v1/ticker/")));system("clear");j[0,20].tap{puts "#{"-"*50}\n#{"Name".ljust(10)} Price \t%(1h) %(24h) %(7d)\n#{"-"*50}"}.each{|x|puts"#{x["symbol"].ljust(10)}$#{x["price_usd"]}\t#{x["percent_change_1h"]}%\t#{x["percent_change_24h"]}%\t#{x["percent_change_7d"]}%"};sleep(1)}'
@nicolasleander
Copy link
Author

nicolasleander commented Jun 11, 2017

Usage

bash <(curl https://goo.gl/9cL6lf -Lfs)

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment