Move thumb to end of xmrtall
This commit is contained in:
parent
16a9bab4f3
commit
5531343475
43
price.py
43
price.py
|
@ -690,27 +690,6 @@ def tall(bot, trigger):
|
||||||
def xmrtall(bot, trigger):
|
def xmrtall(bot, trigger):
|
||||||
stringtosend = ''
|
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
|
# Polo
|
||||||
try:
|
try:
|
||||||
r=requests.get(polourl)
|
r=requests.get(polourl)
|
||||||
|
@ -785,6 +764,28 @@ def xmrtall(bot, trigger):
|
||||||
except:
|
except:
|
||||||
bot.say("Something borked ( -.-)ノ-=≡≡卍")
|
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
|
# Tux
|
||||||
# try:
|
# try:
|
||||||
# r = requests.get('https://tuxexchange.com/api?method=getticker')
|
# r = requests.get('https://tuxexchange.com/api?method=getticker')
|
||||||
|
|
Loading…
Reference in New Issue