Skip to content

Instantly share code, notes, and snippets.

@zQueal
Created November 5, 2015 00:57
Show Gist options
  • Select an option

  • Save zQueal/0c467f9a949328ef41a0 to your computer and use it in GitHub Desktop.

Select an option

Save zQueal/0c467f9a949328ef41a0 to your computer and use it in GitHub Desktop.
FishShell function to pull BTC price and watch current BTC buy/sell prices. Requires httpie and jq.
function btc --description 'show the current buy/sell price of btc based on Coinbase prices'
http GET https://api.coinbase.com/v2/prices/buy | jq '{buy: .data.amount}'
http GET https://api.coinbase.com/v2/prices/sell | jq '{sell: .data.amount}'
end
function watch_btc --description 'displays buy/sell every 5 minutes'
while true
btc
sleep 300
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment