diff --git a/network.py b/network.py index 3e35130..efd0e08 100644 --- a/network.py +++ b/network.py @@ -63,14 +63,19 @@ def blocksize(bot, trigger): except: bot.say("Bomething sorked 0_0") +@sopel.module.commands('mine') +def mine(bot, trigger): + try: + r=requests.get('https://supportxmr.com/api/network/stats') + j=r.json() + diff=float(j['difficulty']) + value=float(j['value'])/1e12 + hashrate=float(trigger.group(2)) + xmrperday=(hashrate/(diff/120))*720*value + bot.say("At {:.0f} h/s with network diff of {:.2e} and block reward {:.2f} you can expect {:.4f} XMR per day.".format(hashrate, diff, value, xmrperday)) + except: + bot.say("Mining is for suckers.") + @sopel.module.commands('b2x') def b2x(bot, trigger): - try: - r=requests.get('https://blockchain.info/latestblock') - j=r.json() - height=j['height'] - forkheight=494784 - blocks=forkheight-int(height) - bot.say("Bitcoin S2X fork due to happen on block {}. Current block is {}. 10 min per block estimate gives {} min, or {:.2f} hour, or {:.2f} days.".format(forkheight, height, blocks*10, blocks*0.16666, blocks*0.006944)) - except: - bot.say("Bitcoin sucks.") + bot.say("Fuck off \\x") diff --git a/price.py b/price.py index 2442274..ff6ea8d 100644 --- a/price.py +++ b/price.py @@ -491,6 +491,8 @@ def tall(bot, trigger): try: thumbresult = requests.get(thumbbtcurl) thumbjson = thumbresult.json() + if thumbjson['data']: + pass except: thumbjson = False if thumbjson: