old_contents: from util import http, hook
  
  
  @hook.command(autohelp=False)
  def bitcoin(inp, say=None):
      ".bitcoin -- gets current exchange rate for bitcoins from BTC-e"
      data = http.get_json("https://btc-e.com/api/2/btc_usd/ticker")
      say("USD/BTC: \x0307{buy:.0f}\x0f - High: \x0307{high:.0f}\x0f"
              " - Low: \x0307{low:.0f}\x0f - Volume: {vol_cur:.0f}".format(**data['ticker']))
  
  @hook.command(autohelp=False)
  def ethereum(inp, say=None):
      ".ethereum -- gets current exchange rate for ethereum from BTC-e"
      data = http.get_json("https://btc-e.com/api/2/eth_usd/ticker")
      say("USD/ETH: \x0307{buy:.0f}\x0f - High: \x0307{high:.0f}\x0f"
              " - Low: \x0307{low:.0f}\x0f - Volume: {vol_cur:.0f}".format(**data['ticker']))
  
new_contents: from util import http, hook
  
  
  @hook.command(autohelp=False)
  def bitcoin(inp, say=None):
      ".bitcoin -- gets current exchange rate for bitcoins from Bitstamp"
      data = http.get_json("https://www.bitstamp.net/api/ticker/")
      say("USD/BTC: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f -"
          " Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} BTC"
          .format(float(data['last']),
                  float(data['high']),
                  float(data['low']),
                  float(data['volume'])))
  
  
  @hook.command(autohelp=False)
  def ethereum(inp, say=None):
      ".ethereum -- gets current exchange rate for ethereum from Bitstamp"
      data = http.get_json("https://www.bitstamp.net/api/v2/ticker/ethusd")
      say("USD/ETH: \x0307${:,.2f}\x0f - High: \x0307${:,.2f}\x0f -"
          " Low: \x0307${:,.2f}\x0f - Volume: {:,.2f} ETH"
          .format(float(data['last']),
                  float(data['high']),
                  float(data['low']),
                  float(data['volume'])))
  
subject: fix bit/eth: swap to bitstamp API (#169)