Skip to content

Instantly share code, notes, and snippets.

@mattb
Last active August 29, 2015 14:03
Show Gist options
  • Save mattb/90b7d6f9bc1f96ddb3af to your computer and use it in GitHub Desktop.
Save mattb/90b7d6f9bc1f96ddb3af to your computer and use it in GitHub Desktop.
Check the mayday.us total once every 60 seconds and print stats.
ruby -rjson -ropen-uri -e 'last = - 1; while true; dollars=(JSON.parse(open("https://pledge.mayday.us/r/total").read)["totalCents"] - 100000000)/100; puts "$#{dollars} raised. $#{5000000-dollars} to go.#{last == -1 ? "" : " #{sprintf("%6s", "$"+(dollars-last).to_s)} in the last 60 seconds. #{"*" * ((dollars-last)/250.0).round}"}"; last = dollars; sleep 60 ; end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment