Skip to content

Instantly share code, notes, and snippets.

@hubert3
Last active October 20, 2023 21:12
Show Gist options
  • Save hubert3/6621972 to your computer and use it in GitHub Desktop.
Save hubert3/6621972 to your computer and use it in GitHub Desktop.
#!/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))
@intelliot
Copy link

+1 @ezfe's request

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