Created
July 4, 2014 21:03
-
-
Save christinac/e99a2a711ce8e8be228d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| ruby -r json -r open-uri -e 'last = nil; rem_t = nil; while true; dollars=(JSON.parse(open("https://pledge.mayday.us/r/total").read)["totalCents"] - 100000000)/100; rem = 5000000-dollars; puts "$#{dollars} raised. $#{rem} to go."; (last = dollars; sleep 60; next) unless last; delta_rem_t = (rem.to_f / ((dollars - last) * 60)); rem_t = rem_t ? (0.85 * rem_t + 0.15 * delta_rem_t) : delta_rem_t; puts " $#{dollars-last} in the last 60 seconds. #{rem_t} hours to go."; last = dollars; sleep 60 ; end' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment