Add litecoin command reading from BTC-E

This commit is contained in:
thenoodle68 2013-11-28 18:48:11 +08:00
parent cbe4e3177e
commit 2e66e03c7d
1 changed files with 8 additions and 0 deletions

View File

@ -14,3 +14,11 @@ def bitcoin(inp, message=None):
}
message("Current: \x0307{!s}\x0f - High: \x0307{!s}\x0f"
" - Low: \x0307{!s}\x0f - Volume: {!s}".format(ticker['buy'], ticker['high'], ticker['low'], ticker['vol']))
@hook.command(autohelp=False)
def litecoin(inp, message=None):
"""litecoin -- gets current exchange rate for litecoins from BTC-E"""
data = http.get_json("https://btc-e.com/api/2/ltc_usd/ticker")
ticker = data['ticker']
message("Current: \x0307${!s}\x0f - High: \x0307${!s}\x0f"
" - Low: \x0307${!s}\x0f - Volume: {!s}LTC".format(ticker['buy'],ticker['high'],ticker['low'],ticker['vol_cur']))