More refactoring! Break everything!

This commit is contained in:
Luke Rogers 2013-10-01 16:55:18 +13:00
parent 51c866de6d
commit 42a72f068e
6 changed files with 36 additions and 30 deletions

View file

@ -2,7 +2,7 @@ from util import http, hook
@hook.command(autohelp=False)
def bitcoin(inp, say=None):
def bitcoin(inp, message=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']
@ -12,5 +12,5 @@ def bitcoin(inp, say=None):
'low': data['low']['display_short'].encode('ascii','ignore'),
'vol': data['vol']['display_short'].encode('ascii','ignore'),
}
say("Current: \x0307{!s}\x0f - High: \x0307{!s}\x0f"
message("Current: \x0307{!s}\x0f - High: \x0307{!s}\x0f"
" - Low: \x0307{!s}\x0f - Volume: {!s}".format(ticker['buy'],ticker['high'],ticker['low'],ticker['vol']))