From 2e66e03c7d8a17dd10f123c3b6f08063d8502dcb Mon Sep 17 00:00:00 2001 From: thenoodle68 Date: Thu, 28 Nov 2013 18:48:11 +0800 Subject: [PATCH] Add litecoin command reading from BTC-E --- plugins/bitcoin.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/bitcoin.py b/plugins/bitcoin.py index 9ed6fbc..b06e3ee 100755 --- a/plugins/bitcoin.py +++ b/plugins/bitcoin.py @@ -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']))