citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

btc-price (421B)


      1 #!/usr/bin/env bash
      2 pair=XXBTZCAD
      3 cad=$(curl -sL "https://api.kraken.com/0/public/Ticker?pair=$pair" | jq -r ".result.$pair.a[0]" &)
      4 usd=$(curl -sL 'https://api.bitfinex.com/v2/tickers?symbols=tBTCUSD' | jq '.[0][1]' &)
      5 #cad=$(curl -sL 'https://apiv2.bitcoinaverage.com/indices/global/ticker/all?crypto=BTC&fiat=CAD' | jq -r '.BTCCAD.last')
      6 #jcalc=$(bc -l <<<"$cad * $nbtc")
      7 wait
      8 printf "$%s USD, %s CAD\n" "$usd" "$cad"