Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Standard modules, wget, Selenium
- import random
- import os
- import sys
- import requests
- import re
- from bs4 import BeautifulSoup
- from time import sleep
- global goods
- goods = 0
- global wallets
- wallets = 1
- def getBlockChain(t1):
- global wallets
- global goods
- # From directory.io, query blockchain
- target = t1[0]
- header = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36", "Cache-Control":"no-cache"}
- response = requests.get(target,headers=header)
- html = response.content
- soup = BeautifulSoup(html,'lxml')
- transactions = soup.findAll('td', {'id':re.compile('final_balance')})
- c = str(transactions[0])[57:]
- c = c[:-23]
- coins = c.split('">')
- satoshis = int(coins[0])
- btcs = float(coins[1])
- if satoshis == 0:
- print "Wallet %s is empty. Checked %s wallets in %s pages (%s good)" % (t1[1], wallets, t1[3], goods)
- elif satoshis > 0:
- loot = "THERE'S LOOT HERE!\nPage: %s\nWallet: %s\nBTC(Satoshis): %s(%s)\nChecked %s wallets, %s good\n" % (t1[2], t1[1], btcs, satoshis, wallets, goods)
- print loot
- print "Writing to loot.txt..."
- lootxt = open("lootxt", 'a')
- lootxt.write(loot)
- lootxt.close()
- wallets = wallets + 1
- def getpagedata(index,iters):
- print "Getting page %s! (%s pages so far!)" % (index,iters)
- target = "http://directory.io/"
- target = target + str(index)
- header = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"}
- response = requests.get(target,headers=header)
- html = response.content
- soup = BeautifulSoup(html, "lxml")
- links = soup.findAll('a', attrs={'href': re.compile("^https://blockchain.info/address/")})
- array = []
- for i in links:
- array.append(i)
- while array:
- string = str(array[0])
- temp = string.split('<a href="')
- temp.pop(0)
- temp = temp[0].split('">')
- temp.append(index)
- temp.append(iters)
- temp[1] = temp[1][:-4]
- getBlockChain(temp)
- array.pop(0)
- wait = random.uniform(0.0,1.0)
- sleep(wait)
- getpagedata(int(index)+1,int(iters)+1)
- index = raw_input("What page do we start at?\n>")
- getpagedata(index,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement