From 726bf0dd4be810aafbc884fc5bf7d48c05982a7b Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Thu, 30 Jan 2014 11:42:54 -0800 Subject: [PATCH] bitcoin: use BTC-e instead of MtGox --- plugins/bitcoin.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/bitcoin.py b/plugins/bitcoin.py index 21625b6..47d5c0c 100644 --- a/plugins/bitcoin.py +++ b/plugins/bitcoin.py @@ -3,14 +3,7 @@ from util import http, hook @hook.command(autohelp=False) def bitcoin(inp, say=None): - ".bitcoin -- gets current exchange rate for bitcoins from mtgox" - data = http.get_json("https://data.mtgox.com/api/2/BTCUSD/money/ticker") - data = data['data'] - ticker = { - 'buy': data['buy']['display_short'], - 'high': data['high']['display_short'], - 'low': data['low']['display_short'], - 'vol': data['vol']['display_short'], - } - say("Current: \x0307%(buy)s\x0f - High: \x0307%(high)s\x0f" - " - Low: \x0307%(low)s\x0f - Volume: %(vol)s" % ticker) + ".bitcoin -- gets current exchange rate for bitcoins from BTC-e" + data = http.get_json("https://btc-e.com/api/2/btc_usd/ticker") + say("BTC/USD: \x0307{buy:.0f}\x0f - High: \x0307{high}\x0f" + " - Low: \x0307{low}\x0f - Volume: {vol_cur:.0f}".format(**data['ticker']))