From 039fa64a27d132415003ccd334e106f1c14da2ae Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 10 Jun 2011 21:04:52 -0600 Subject: [PATCH] bitcoin.py: get market rate for bitcoins from mtgox --- plugins/bitcoin.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 plugins/bitcoin.py diff --git a/plugins/bitcoin.py b/plugins/bitcoin.py new file mode 100644 index 0000000..cdcb339 --- /dev/null +++ b/plugins/bitcoin.py @@ -0,0 +1,10 @@ +from util import http, hook + + +@hook.command(autohelp=False) +def bitcoin(inp, say=None): + ".bitcoin -- gets current exchange rate for bitcoins from mtgox" + 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)