commit
245c49a165
28
price.py
28
price.py
|
@ -397,8 +397,14 @@ def ogre(bot, trigger):
|
||||||
|
|
||||||
@sopel.module.commands('trex', 'bittrex')
|
@sopel.module.commands('trex', 'bittrex')
|
||||||
def trex(bot, trigger):
|
def trex(bot, trigger):
|
||||||
|
geturl = ""
|
||||||
if not trigger.group(2):
|
if not trigger.group(2):
|
||||||
geturl = trexurl+'xmr'
|
bot.say("spineless...")
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
if trigger.group(2) == "xmr":
|
||||||
|
bot.say("spineless")
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
geturl = trexurl + trigger.group(2)
|
geturl = trexurl + trigger.group(2)
|
||||||
try:
|
try:
|
||||||
|
@ -664,17 +670,17 @@ def xmrtall(bot, trigger):
|
||||||
bot.say("Borka borka ┌∩┐(◣_◢)┌∩┐")
|
bot.say("Borka borka ┌∩┐(◣_◢)┌∩┐")
|
||||||
|
|
||||||
# Trex
|
# Trex
|
||||||
geturl = trexurl+'xmr'
|
# geturl = trexurl+'xmr'
|
||||||
try:
|
# try:
|
||||||
r = requests.get(geturl)
|
# r = requests.get(geturl)
|
||||||
j = r.json()
|
# j = r.json()
|
||||||
xmr=j['result'][0]
|
# xmr=j['result'][0]
|
||||||
last=float(xmr['Last'])
|
# last=float(xmr['Last'])
|
||||||
# change=((last/float(xmr['PrevDay']))-1)
|
# change=((last/float(xmr['PrevDay']))-1)
|
||||||
vol=float(xmr['BaseVolume'])
|
# vol=float(xmr['BaseVolume'])
|
||||||
stringtosend += "Bittrex last: {0:.6f} BTC on {1:.2f} BTC volume | ".format(last, vol)
|
# stringtosend += "Bittrex last: {0:.6f} BTC on {1:.2f} BTC volume | ".format(last, vol)
|
||||||
except:
|
# except:
|
||||||
bot.say("Something borked -_-")
|
# bot.say("Something borked -_-")
|
||||||
|
|
||||||
#Finally... print to IRC
|
#Finally... print to IRC
|
||||||
bot.say(stringtosend[:-2])
|
bot.say(stringtosend[:-2])
|
||||||
|
|
Loading…
Reference in New Issue