This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/bitcoin.py

11 lines
389 B
Python
Raw Normal View History

2011-11-20 10:23:31 +01:00
from util import http, hook
@hook.command(autohelp=False)
def bitcoin(inp, say=None):
2012-05-16 05:07:27 +02:00
"bitcoin -- Gets current exchange rate for bitcoins from mtgox."
2011-11-20 10:23:31 +01:00
data = http.get_json("https://mtgox.com/code/data/ticker.php")
ticker = data['ticker']
say("Current: \x0307$%(buy).2f\x0f - High: \x0307$%(high).2f\x0f"
" - Low: \x0307$%(low).2f\x0f - Volume: %(vol)s" % ticker)