Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SamouraiDev/c544903aa59434a946a3949e53beef39 to your computer and use it in GitHub Desktop.
Save SamouraiDev/c544903aa59434a946a3949e53beef39 to your computer and use it in GitHub Desktop.
Wannacry btc balance
import urllib2
import json
addr = [ "12t9YDPgwueZ9NyMgw519p7AA8isjr6SMw",
"1QAc9S5EmycqjzzWDc1yiWzr9jJLC8sLiY",
"115p7UMMngoj1pMvkpHijcRdfJNXj6LrLn",
"13AM4VW2dhxYgXeQepoHkHSQuy6NgaEb94",
"15zGqZCTcys6eCjDkE3DypCjXi6QWRV6V1"]
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