Post
Topic
Board Pools
Re: [∞ YH] solo.ckpool.org 0.5% fee anonymous solo bitcoin mining! 32 blocks solved!
by
zapphood
on 10/04/2015, 12:35:10 UTC

I modified the script with a unixtime stamp converter to show the lastupdate correct and i modified the layout for me.


Modified Script Download: solo-mining-stats-new.zip



How do I know that code is clean?  I do not install/run things from random uploads.

Hmmmm...but you download the script from github, how do you know that this code is clean?  Wink Cheesy

the zipfile was only a little help for you....but it is no problem that you don't trust me.

here ist the modified script as source (check.py) to copy & paste if you want.

cheers,
zapphood

Code:
#!/usr/bin/python
import sys
import datetime
import requests
import dateutil.relativedelta
import time
import os


from colorama import init, Back, Fore

init()

clear = lambda: os.system('cls')
clear()

# Welcome, check your stats for the solo.ckpool.org pool, edit the file addr.txt with your Bitcoin address, your balance will be checked around every 10 minute.
# If you see the background green, you won the jackpot! press a key to skip'
#
# Made by yqons (Donate 1GrC12hbtMNPiYumftZ4B3Y1MVyCuZrKeM)
#
# Modified by Zapphood


#load address
with open('addr.txt', 'r') as f:
  addr = str(f.readline()).strip()
#check if is correct
urlx1 = 'https://blockexplorer.com/q/addressbalance/' + addr
response12 = requests.get(urlx1)
datax2 = float(response12.text)

#check your last block found on the pool
with open('blocks.txt', 'r') as f2:
  lastbf = str(f2.readline()).strip()

if datax2>=0:
urlx1x = 'http://solo.ckpool.org/users/' + addr
response12x = requests.get(urlx1x)
datax2x = str(response12x.text)
if not datax2x[:1]=='<':
print("Address loaded correctly, GOOD LUCK!")
else:
print("Address not found on the pool, please check your address inside addr.txt")
sys.exit()
else:
print("Address error, please check your address inside addr.txt")
sys.exit()


time.sleep(1.55)

url12 = 'https://blockexplorer.com/q/getdifficulty'
response1212 = requests.get(url12)
datax12 = '{0:.3f}'.format(float(response1212.text))
netdiff = datax12

#timer
x=0

while True:

x+=1

#jackpot check every 10 minutes(around) this is the block time avg
if not x%8:
urlx = 'https://blockchain.info/address/1PKN98VN2z5gwSGZvGKS2bj8aADZBkyhkZ?format=json'
response1 = requests.get(urlx)
datax = response1.json()
blockrec = str(datax['txs'][0][u'block_height'])
if datax['txs'][0][u'out'][0][u'addr']==addr and lastbf!=blockrec :
clear()
text = str(float(datax['txs'][0][u'out'][0][u'value'])/100000000) +" *********** JACKPOT *********** "+ str(float(datax['txs'][0][u'out'][0][u'value'])/100000000) +" (send me some LOL)"
print(Back.YELLOW + text)
print(Back.RED + text)
print(Back.GREEN + text)
print(Fore.YELLOW + text)
print(Fore.RED + text)
print(Fore.BLACK + text)
print ""
print "Block Height: " + blockrec

f = open('blocks.txt','w')
f.write(blockrec)

time.sleep(0.1)

break

url = 'http://solo.ckpool.org/users/' + addr
response = requests.get(url)
data = response.json()
m1avg = data['hashrate1m']
m5avg = data['hashrate5m']
h1avg = data['hashrate1hr']
d1avg = data['hashrate1d']
d7avg = data['hashrate7d']


bests = '{0:.3f}'.format(float(data['bestshare']))

clear()
print 'Stats for BTC Address: ' + addr
print ''
        print 'Lastupdate: ' + time.ctime(int(data['lastupdate']))
        print ''
print 'Hashrate (1m): ' + str(m1avg) + 'H/s'
print 'Hashrate (5m): ' + str(m5avg) + 'H/s'
print 'Hashrate (1h): ' + str(h1avg) + 'H/s'
print 'Hashrate (1d): ' + str(d1avg) + 'H/s'
print 'Hashrate (7d): ' + str(d7avg) + 'H/s'
print ''
print 'Net. Diff.: ' + str(netdiff)
print 'Best share: ' + str(bests)


time.sleep(75)