From c2c8ed4f67967757318a2fe19654a9cba56f7222 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 9 Aug 2017 00:06:59 +0000 Subject: [PATCH] Fix new krak trigger option --- price.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/price.py b/price.py index 932edf3..157de45 100644 --- a/price.py +++ b/price.py @@ -19,7 +19,7 @@ krakbtc = 'https://api.kraken.com/0/public/Ticker?pair=XMRXBT' krakbtceur = 'https://api.kraken.com/0/public/Ticker?pair=XBTEUR' krakusd = 'https://api.kraken.com/0/public/Ticker?pair=XMRUSD' krakeur = 'https://api.kraken.com/0/public/Ticker?pair=XMREUR' -kraktrig = 'https://api.kraken.com/0/public/Ticker?pair=XBT' #append coin/trigger in function below +kraktrig = 'https://api.kraken.com/0/public/Ticker?pair=' #append coin/trigger in function below okcquar = 'https://www.okcoin.com/api/v1/future_ticker.do?symbol=btc_usd&contract_type=quarter' krakusdt = 'http://api.kraken.com/0/public/Ticker?pair=USDTUSD' bitflyerurl = 'https://api.bitflyer.jp/v1/ticker' @@ -96,11 +96,9 @@ def krak(bot, trigger): else: coin = trigger.group(2).upper() try: - kraktrig = kraktrig[:-1] #Didn't test. It's meant to delete the "'" from end of string. Delete this line if unneeded. - kraktrig = kraktrig.append(coin)+"'" #Again, delete the +"'" at the end, if unneeded. - r=requests.get(kraktrig) + r=requests.get(kraktrig+coin+'XBT') j=r.json() - stringtosay += coin + " at {0:.2f} on {1:.2f} 24 h BTC volume. ".format(float(j['result']['X'+str(coin)+'XXBT']['c'][0]), float(j['result']['X'+str(coin)+'XXBT']['v'][1])) + stringtosay += "{0} at {1:.2f} on {2:.2f} 24 h {0} volume. ".format(coin, float(j['result']['X'+str(coin)+'XXBT']['c'][0]), float(j['result']['X'+str(coin)+'XXBT']['v'][1])) except: bot.say("Error connecting to Kraken") # if len(coin) > 5 or len(coin) < 2: