update before pull
This commit is contained in:
parent
9c30cd3002
commit
d15a3d5a8a
12
network.py
12
network.py
|
@ -76,6 +76,18 @@ def mine(bot, trigger):
|
||||||
except:
|
except:
|
||||||
bot.say("Mining is for suckers.")
|
bot.say("Mining is for suckers.")
|
||||||
|
|
||||||
|
@sopel.module.commands('solo')
|
||||||
|
def solo(bot, trigger):
|
||||||
|
try:
|
||||||
|
r=requests.get('https://supportxmr.com/api/network/stats')
|
||||||
|
j=r.json()
|
||||||
|
diff=float(j['difficulty'])
|
||||||
|
hashrate=float(trigger.group(2))
|
||||||
|
timetoblock=(diff/hashrate)
|
||||||
|
bot.say("At {:.0f} h/s with network diff of {:.2e} your expected time for find a block is {:.2e} s or {:.2f} days.".format(hashrate, diff, timetoblock, timetoblock/(60*60*24)))
|
||||||
|
except:
|
||||||
|
bot.say("Mining is for suckers.")
|
||||||
|
|
||||||
@sopel.module.commands('b2x')
|
@sopel.module.commands('b2x')
|
||||||
def b2x(bot, trigger):
|
def b2x(bot, trigger):
|
||||||
bot.say("Fuck off \\x")
|
bot.say("Fuck off \\x")
|
||||||
|
|
60
price.py
60
price.py
|
@ -26,26 +26,22 @@ bitflyerurl = 'https://api.bitflyer.jp/v1/ticker'
|
||||||
thumbxmrurl = 'https://api.bithumb.com/public/ticker/xmr' # measured natively in KRW
|
thumbxmrurl = 'https://api.bithumb.com/public/ticker/xmr' # measured natively in KRW
|
||||||
thumbbtcurl = 'https://api.bithumb.com/public/ticker/btc' # measured natively in KRW
|
thumbbtcurl = 'https://api.bithumb.com/public/ticker/btc' # measured natively in KRW
|
||||||
|
|
||||||
|
@sopel.module.commands('forksum')
|
||||||
@sopel.module.commands('bch', 'bitcointrash')
|
def forksum(bot, trigger):
|
||||||
def bch(bot, trigger):
|
|
||||||
url = 'https://api.coinmarketcap.com/v1/ticker/?bch'
|
url = 'https://api.coinmarketcap.com/v1/ticker/?bch'
|
||||||
try:
|
try:
|
||||||
r = requests.get(url)
|
r = requests.get(url)
|
||||||
j = r.json()
|
j = r.json()
|
||||||
for i in j:
|
for i in j:
|
||||||
try:
|
try:
|
||||||
|
if i['id'] == 'bitcoin':
|
||||||
|
btcprice = float(i['price_usd'])
|
||||||
if i['id'] == 'bitcoin-cash':
|
if i['id'] == 'bitcoin-cash':
|
||||||
coin = i
|
bcashprice = float(i['price_usd'])
|
||||||
|
if i['id'] == 'bitcoin-gold':
|
||||||
|
bgoldprice = float(i['price_usd'])
|
||||||
except: pass
|
except: pass
|
||||||
symbol = coin['symbol']
|
bot.say("The sum of USD price of BTC, BCH, and BTG is ${:.2f}".format(btcprice+bcashprice+bgoldprice))
|
||||||
name = coin['name']
|
|
||||||
rank = coin['rank']
|
|
||||||
price_usd = float(coin['price_usd'])
|
|
||||||
price_btc = float(coin['price_btc'])
|
|
||||||
volume_usd = float(coin['24h_volume_usd'])
|
|
||||||
percent_change_24h = float(coin['percent_change_24h'])
|
|
||||||
bot.say("{0} ({1}) is #{2}. Last price ${3:.2f} / ฿{4:.8f}. 24h volume ${5:,.0f} changed {6}%.".format(name, symbol, rank, price_usd, price_btc, volume_usd, percent_change_24h))
|
|
||||||
except:
|
except:
|
||||||
bot.say("Error parsing ticker")
|
bot.say("Error parsing ticker")
|
||||||
|
|
||||||
|
@ -475,10 +471,12 @@ def tall(bot, trigger):
|
||||||
try:
|
try:
|
||||||
gdaxresult = requests.get(gdaxurl)
|
gdaxresult = requests.get(gdaxurl)
|
||||||
gdaxjson = gdaxresult.json()
|
gdaxjson = gdaxresult.json()
|
||||||
|
gdaxprice = float(gdaxjson['price'])
|
||||||
|
gdaxvolume = float(gdaxjson['volume'])
|
||||||
except:
|
except:
|
||||||
gdaxjson = False
|
gdaxjson = False
|
||||||
if gdaxjson:
|
if gdaxjson:
|
||||||
stringtosend += "GDAX price: {0:,.2f}, vol: {1:,.1f} | ".format(float(gdaxjson['price']), float(gdaxjson['volume']))
|
stringtosend += "GDAX price: {0:,.2f}, vol: {1:,.1f} | ".format(gdaxprice, gdaxvolume)
|
||||||
# Bitfinex
|
# Bitfinex
|
||||||
try:
|
try:
|
||||||
finexresult = requests.get(finexurl)
|
finexresult = requests.get(finexurl)
|
||||||
|
@ -525,7 +523,7 @@ def tall(bot, trigger):
|
||||||
bot.say(stringtosend)
|
bot.say(stringtosend)
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.commands('xmrtall')
|
@sopel.module.commands('xmrtall', 'xmr')
|
||||||
def xmrtall(bot, trigger):
|
def xmrtall(bot, trigger):
|
||||||
stringtosend = ''
|
stringtosend = ''
|
||||||
|
|
||||||
|
@ -882,7 +880,7 @@ def log(bot, trigger):
|
||||||
@sopel.module.commands('price')
|
@sopel.module.commands('price')
|
||||||
def price(bot, trigger):
|
def price(bot, trigger):
|
||||||
try:
|
try:
|
||||||
bot.say("1 XMR = $1,000 USD (Offer valid in participating locations)")
|
bot.say("1 XMR = $12,345 USD (Offer valid in participating locations)")
|
||||||
except:
|
except:
|
||||||
bot.say("C-cex sucks")
|
bot.say("C-cex sucks")
|
||||||
|
|
||||||
|
@ -910,3 +908,35 @@ def commodity(bot, trigger):
|
||||||
except:
|
except:
|
||||||
bot.say("Monerobux fails again...")
|
bot.say("Monerobux fails again...")
|
||||||
|
|
||||||
|
@sopel.module.commands('xmy')
|
||||||
|
def xmy(bot, trigger):
|
||||||
|
try:
|
||||||
|
r = requests.get('https://api.coinmarketcap.com/v1/ticker?limit=500')
|
||||||
|
j = r.json()
|
||||||
|
except:
|
||||||
|
bot.say("Can't connect to API")
|
||||||
|
symbol = 'XMY'
|
||||||
|
try:
|
||||||
|
for i in j:
|
||||||
|
try:
|
||||||
|
if i['symbol'] == symbol:
|
||||||
|
coin = i
|
||||||
|
except: pass
|
||||||
|
try:
|
||||||
|
if i['rank'] == str(rank):
|
||||||
|
coin = i
|
||||||
|
except: pass
|
||||||
|
symbol = coin['symbol']
|
||||||
|
name = coin['name']
|
||||||
|
rank = coin['rank']
|
||||||
|
price_usd = float(coin['price_usd'])
|
||||||
|
price_btc = float(coin['price_btc'])
|
||||||
|
volume_usd = float(coin['24h_volume_usd'])
|
||||||
|
market_cap_usd = float(coin['market_cap_usd'])
|
||||||
|
available_supply = float(coin['available_supply'])
|
||||||
|
total_supply = float(coin['total_supply'])
|
||||||
|
percent_change_24h = float(coin['percent_change_24h'])
|
||||||
|
bot.say("{0} ({1}) is #{2}. Last price ${3:.2f} / ฿{4:.8f}. 24h volume ${5:,.0f} changed {6}%. Market cap ${7:,.0f}. Available / total coin supply {8:,.0f} / {9:,.0f}.".format(name, symbol, rank, price_usd, price_btc, volume_usd, percent_change_24h, market_cap_usd, available_supply, total_supply))
|
||||||
|
except:
|
||||||
|
bot.say("Error parsing ticker")
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,12 @@ from threading import Timer
|
||||||
def fourmatter(bot, trigger):
|
def fourmatter(bot, trigger):
|
||||||
bot.say('Irish I be fookin <3 Milo')
|
bot.say('Irish I be fookin <3 Milo')
|
||||||
|
|
||||||
|
@sopel.module.commands('allah')
|
||||||
|
def allah(bot, trigger):
|
||||||
|
bot.say('allah is doing')
|
||||||
|
bot.say('sun is not doing allah is doing')
|
||||||
|
bot.say('to accept Islam say that i bear witness that there is no deity worthy of worship except Allah and Muhammad peace be upon him is his slave and messenger')
|
||||||
|
|
||||||
@sopel.module.commands('aminorex')
|
@sopel.module.commands('aminorex')
|
||||||
def aminorex(bot, trigger):
|
def aminorex(bot, trigger):
|
||||||
bot.say('if i could replace my wife with a robot... i might seriously think about it')
|
bot.say('if i could replace my wife with a robot... i might seriously think about it')
|
||||||
|
|
Loading…
Reference in New Issue