Merge pull request #63 from scoobybejesus/patch-9
Make friendly for python3
This commit is contained in:
commit
224b2c1604
19
price.py
19
price.py
|
@ -243,11 +243,11 @@ def lending(bot, trigger):
|
||||||
currenttime=time.time()
|
currenttime=time.time()
|
||||||
for i in j['offers']:
|
for i in j['offers']:
|
||||||
amnt+=float(i['amount'])
|
amnt+=float(i['amount'])
|
||||||
bot.say("Total amount of XMR available {0:,.2f}. Changed by {1:.2f} in the last {2:.2f} hours".format(amnt, amnt-prevamnt, (currenttime-prevtime)/3600))
|
|
||||||
global prevamnt
|
global prevamnt
|
||||||
prevamnt=amnt
|
prevamnt=amnt
|
||||||
global prevtime
|
global prevtime
|
||||||
prevtime=currenttime
|
prevtime=currenttime
|
||||||
|
bot.say("Total amount of XMR available {0:,.2f}. Changed by {1:.2f} in the last {2:.2f} hours".format(amnt, amnt-prevamnt, (currenttime-prevtime)/3600))
|
||||||
except:
|
except:
|
||||||
bot.say("Something bad happened :o")
|
bot.say("Something bad happened :o")
|
||||||
|
|
||||||
|
@ -276,7 +276,6 @@ def metal(bot, trigger):
|
||||||
|
|
||||||
|
|
||||||
@sopel.module.commands('polo', 'poloniex', 'marco', 'plol')
|
@sopel.module.commands('polo', 'poloniex', 'marco', 'plol')
|
||||||
@sopel.module.interval(3600)
|
|
||||||
def polo(bot, trigger):
|
def polo(bot, trigger):
|
||||||
if not trigger.group(2):
|
if not trigger.group(2):
|
||||||
try:
|
try:
|
||||||
|
@ -290,21 +289,21 @@ def polo(bot, trigger):
|
||||||
sign = '+'
|
sign = '+'
|
||||||
else:
|
else:
|
||||||
sign = ''
|
sign = ''
|
||||||
face = ''
|
face = u'\u0000'
|
||||||
if change > 0.10:
|
if change > 0.10:
|
||||||
face = u'\u263d'.encode('utf8')
|
face = u'\u263d'
|
||||||
if 0.10 >= change > 0.05:
|
if 0.10 >= change > 0.05:
|
||||||
face = u'\u2661'.encode('utf8')
|
face = u'\u2661'
|
||||||
if 0.05 >= change > 0.02:
|
if 0.05 >= change > 0.02:
|
||||||
face = u'\u263a'.encode('utf8')
|
face = u'\u263a'
|
||||||
if 0.02 >= change > -0.02:
|
if 0.02 >= change > -0.02:
|
||||||
face = u'\u2694'.encode('utf8')
|
face = u'\u2694'
|
||||||
if -0.02 >= change > -0.05:
|
if -0.02 >= change > -0.05:
|
||||||
face = u'\u2639'.encode('utf8')
|
face = u'\u2639'
|
||||||
if -0.05 >= change > -0.1:
|
if -0.05 >= change > -0.1:
|
||||||
face = u'\u2620'.encode('utf8')
|
face = u'\u2620'
|
||||||
if change < -0.1:
|
if change < -0.1:
|
||||||
face = u'\u262d'.encode('utf8')
|
face = u'\u262d'
|
||||||
bot.say("Poloniex at {0:.8f} BTC; {1}{2:.2f}% over 24 hours on {3:.3f} BTC volume {4}".format(last, sign, change*100, vol, face))
|
bot.say("Poloniex at {0:.8f} BTC; {1}{2:.2f}% over 24 hours on {3:.3f} BTC volume {4}".format(last, sign, change*100, vol, face))
|
||||||
except:
|
except:
|
||||||
bot.say("Error retrieving data from Poloniex")
|
bot.say("Error retrieving data from Poloniex")
|
||||||
|
|
Loading…
Reference in New Issue