Skip to content

Instantly share code, notes, and snippets.

@blakebjorn
Created July 5, 2016 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blakebjorn/8ebdd1bc5097affa543f3a171f5391ee to your computer and use it in GitHub Desktop.
Save blakebjorn/8ebdd1bc5097affa543f3a171f5391ee to your computer and use it in GitHub Desktop.
Bash script, returns bitfinex ticker (mid) rounded to two decimal places. I use this for desktop notifications in xfce using genmon.
#!/bin/bash
printf "%.2f" $(curl -s -H "Accept: application/json" -H "Content-Type: application/json" https://api.bitfinex.com/v1/pubticker/btcusd | grep -Po '(?<="mid":")[^"]*')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment