bitcoin.py: get market rate for bitcoins from mtgox

This commit is contained in:
Ryan Hitchman 2011-06-10 21:04:52 -06:00
parent 85da0e2315
commit 039fa64a27
1 changed files with 10 additions and 0 deletions

10
plugins/bitcoin.py Normal file
View File

@ -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)