Move thumb to end of xmrtall

This commit is contained in:
scoobybejesus 2019-07-26 15:59:07 -04:00 committed by GitHub
parent 16a9bab4f3
commit 5531343475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 21 deletions

View File

@ -690,27 +690,6 @@ def tall(bot, trigger):
def xmrtall(bot, trigger):
stringtosend = ''
# Bithumb (Note: Must calculate BTCXMR price from BTCKRW and XMRKRW)
try:
xmr_r = requests.get(thumbxmrurl)
btc_r = requests.get(thumbbtcurl)
xmrjson = xmr_r.json()
btcjson = btc_r.json()
# No last price in api. Must average buy and sell price.
thumbXMRbuy = float(xmrjson['data']['buy_price'])
thumbXMRsell = float(xmrjson['data']['sell_price'])
thumbXMRkrw = (thumbXMRbuy + thumbXMRsell)/2
# Same for BTC
thumbBTCbuy = float(btcjson['data']['buy_price'])
thumbBTCsell = float(btcjson['data']['sell_price'])
thumbBTCkrw = (thumbBTCbuy + thumbBTCsell)/2
# Finally, price in BTC, and volume in XMR
thumbBTCxmr = thumbXMRkrw/thumbBTCkrw
thumbXMRVol = float(xmrjson['data']['volume_1day'])
stringtosend = "Bithumb last: {0:.6f} BTC on {1:.2f} XMR volume | ".format(thumbBTCxmr,thumbXMRVol)
except:
bot.say("Error - bithumb korea is worst korea.")
# Polo
try:
r=requests.get(polourl)
@ -785,6 +764,28 @@ def xmrtall(bot, trigger):
except:
bot.say("Something borked -.--=≡≡卍")
# Bithumb (Note: Must calculate BTCXMR price from BTCKRW and XMRKRW)
try:
xmr_r = requests.get(thumbxmrurl)
btc_r = requests.get(thumbbtcurl)
xmrjson = xmr_r.json()
btcjson = btc_r.json()
# No last price in api. Must average buy and sell price.
thumbXMRbuy = float(xmrjson['data']['buy_price'])
thumbXMRsell = float(xmrjson['data']['sell_price'])
thumbXMRkrw = (thumbXMRbuy + thumbXMRsell)/2
# Same for BTC
thumbBTCbuy = float(btcjson['data']['buy_price'])
thumbBTCsell = float(btcjson['data']['sell_price'])
thumbBTCkrw = (thumbBTCbuy + thumbBTCsell)/2
# Finally, price in BTC, and volume in XMR
thumbBTCxmr = thumbXMRkrw/thumbBTCkrw
thumbXMRVol = float(xmrjson['data']['volume_1day'])
stringtosend = "Bithumb last: {0:.6f} BTC on {1:.2f} XMR volume | ".format(thumbBTCxmr,thumbXMRVol)
except:
bot.say("Error - bithumb korea is worst korea.")
# Tux
# try:
# r = requests.get('https://tuxexchange.com/api?method=getticker')