Last active
October 20, 2023 21:12
-
-
Save hubert3/6621972 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
#!/usr/bin/python | |
import requests, re | |
btc_rate = 139.0 | |
dollar_total = 0.0 | |
btc_total = 0.0 | |
page = requests.get('http://istouchidhackedyet.com/').text | |
dollar_pledges = re.findall(r'-.+\$(\d+)', page) | |
dollar_total = sum(map(float,dollar_pledges)) | |
btc_pledges = re.findall(r'([\d.]+) bitcoin', page, re.IGNORECASE) | |
btc_total += sum(map(float,btc_pledges)) | |
print '%s USD (%s donors)' % (dollar_total, len(dollar_pledges)) | |
print '%s BTC (%s donors)\n' % (btc_total, len(btc_pledges)) | |
print 'TOTAL $%s' % int(round(dollar_total + btc_total*btc_rate,0)) |
I've been having trouble running it, can someone tell me what it outputs at the moment?
+1 @ezfe's request
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated with automatic BTC/USD rate from MtGox https://gist.github.com/anthonymonori/6640288