Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SamouraiDev/264b52e5fcf97cd1ce75419265e2e06e to your computer and use it in GitHub Desktop.
Save SamouraiDev/264b52e5fcf97cd1ce75419265e2e06e to your computer and use it in GitHub Desktop.
Petya btc balance
import urllib2
import json
addr = [ "1Mz7153HMuxXTuR2R1t78mGSdzaAtNbBWX" ]
total = 0;
for i in range(len(addr)):
url = 'https://blockchain.info/address/' + addr[i] + '?format=json'
response = urllib2.urlopen(url)
html = response.read()
jdata = json.loads(html)
print (addr[i] + ":" + str(jdata['final_balance'] / 1e8))
total += jdata['final_balance']
print (str(total / 1e8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment