Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.