From d3fbf1bc804f2bf0d4d3806e692235d3aeef9902 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Sat, 30 Nov 2013 00:05:55 +1300 Subject: [PATCH] bitbitbit --- plugins/coins.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/coins.py b/plugins/coins.py index b40f31f..4aac685 100644 --- a/plugins/coins.py +++ b/plugins/coins.py @@ -6,6 +6,11 @@ from util import http, hook def bitcoin(inp): "bitcoin -- Gets current exchange rate for bitcoins from several exchanges, default is MtGox. Supports MtGox, Bitpay, and BitStamp." exchanges = { + "blockchain": { + "api_url": "https://blockchain.info/ticker", + "func": lambda data: u"Blockchain // Buy: \x0307${:,.2f}\x0f - Sell: \x0307${:,.2f}\x0f".format(data["USD"]["buy"], \ + data["USD"]["sell"]) + }, "mtgox": { "api_url": "https://mtgox.com/api/1/BTCUSD/ticker", "func": lambda data: u"MtGox // Current: \x0307{}\x0f - High: \x0307{}\x0f - Low: \x0307{}\x0f - Best Ask: \x0307{}\x0f - Volume: {}".format(data['return']['last']['display'], \ @@ -31,7 +36,7 @@ def bitcoin(inp): else: return "Invalid Exchange" else: - exchange = exchanges["mtgox"] + exchange = exchanges["blockchain"] data = http.get_json(exchange["api_url"]) func = exchange["func"]