Really fix shortutils
This commit is contained in:
parent
e0bd43f1d2
commit
ceb14eeaad
@ -41,6 +41,7 @@ def doge(phenny, input):
|
|||||||
"""much wow, very function, such programming"""
|
"""much wow, very function, such programming"""
|
||||||
if random.randint(0, 1) == 0:
|
if random.randint(0, 1) == 0:
|
||||||
data, sc = web.get('http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=132')
|
data, sc = web.get('http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=132')
|
||||||
|
data = str(data, 'utf-8')
|
||||||
data = web.json(data)
|
data = web.json(data)
|
||||||
phenny.say("DOGE is at " + data['return']['markets']['DOGE']['lasttradeprice'] + " BTC")
|
phenny.say("DOGE is at " + data['return']['markets']['DOGE']['lasttradeprice'] + " BTC")
|
||||||
else:
|
else:
|
||||||
@ -84,14 +85,9 @@ doge.commands = ['doge']
|
|||||||
|
|
||||||
def btc(phenny, input):
|
def btc(phenny, input):
|
||||||
"""Get current Bitcoin price"""
|
"""Get current Bitcoin price"""
|
||||||
for x in phenny.bot.commands["high"].values():
|
data, sc = web.get('https://blockchain.info/ticker')
|
||||||
if x[0].__name__ == "aa_hook":
|
data = str(data, 'utf-8')
|
||||||
if x[0](phenny, input):
|
data = web.json(data)
|
||||||
return
|
|
||||||
f = urllib2.urlopen('https://blockchain.info/ticker')
|
|
||||||
data = f.read()
|
|
||||||
f.close()
|
|
||||||
data = json.loads(data)
|
|
||||||
if input.group(2):
|
if input.group(2):
|
||||||
currency = input.group(2).strip().upper()
|
currency = input.group(2).strip().upper()
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user