I should check data more often.

This commit is contained in:
Fletcher Boyd 2013-09-06 11:20:34 +08:00
parent c08d3c2daf
commit 363d0ba6d9

View file

@ -7,10 +7,10 @@ def bitcoin(inp, say=None):
data = http.get_json("https://data.mtgox.com/api/2/BTCUSD/money/ticker") data = http.get_json("https://data.mtgox.com/api/2/BTCUSD/money/ticker")
data = data['data'] data = data['data']
ticker = { ticker = {
'buy': data['buy']['display_short'], 'buy': data['buy']['display_short'].encode('ascii','ignore'),
'high': data['high']['display_short'], 'high': data['high']['display_short'].encode('ascii','ignore'),
'low': data['low']['display_short'], 'low': data['low']['display_short'].encode('ascii','ignore'),
'vol': data['vol']['display_short'], 'vol': data['vol']['display_short'].encode('ascii','ignore'),
} }
say("Current: \x0307{}\x0f - High: \x0307{}\x0f" say("Current: \x0307{!s}\x0f - High: \x0307{!s}\x0f"
" - Low: \x0307{}\x0f - Volume: {}".format(data['buy'],data['high'],data['low'],data['vol'])) " - Low: \x0307{!s}\x0f - Volume: {!s}".format(ticker['buy'],ticker['high'],ticker['low'],ticker['vol']))