This commit is contained in:
Luke Rogers 2013-11-30 00:21:26 +13:00
parent d3fbf1bc80
commit 834cbaabd8
1 changed files with 6 additions and 1 deletions

View File

@ -1,10 +1,11 @@
from util import http, hook
@hook.command("butt", autohelp=False)
@hook.command("btc", autohelp=False)
@hook.command(autohelp=False)
def bitcoin(inp):
"bitcoin <exchange> -- Gets current exchange rate for bitcoins from several exchanges, default is MtGox. Supports MtGox, Bitpay, and BitStamp."
"bitcoin <exchange> -- Gets current exchange rate for bitcoins from several exchanges, default is Blockchain. Supports MtGox, Bitpay, Coinbase and BitStamp."
exchanges = {
"blockchain": {
"api_url": "https://blockchain.info/ticker",
@ -17,6 +18,10 @@ def bitcoin(inp):
data['return']['high']['display'], data['return']['low']['display'], data['return']['buy']['display'], \
data['return']['vol']['display'])
},
"coinbase":{
"api_url": "https://coinbase.com/api/v1/prices/spot_rate",
"func": lambda data: u"Coinbase // Current: \x0307${:,.2f}\x0f".format(float(data['amount']))
},
"bitpay": {
"api_url": "https://bitpay.com/api/rates",
"func": lambda data: u"Bitpay // Current: \x0307${:,.2f}\x0f".format(data[0]['rate'])