Skip to content

Instantly share code, notes, and snippets.

@rynote
Last active January 7, 2018 07:35
Show Gist options
  • Save rynote/9dc0b2736e70a3cf04676277e4aa8357 to your computer and use it in GitHub Desktop.
Save rynote/9dc0b2736e70a3cf04676277e4aa8357 to your computer and use it in GitHub Desktop.
#pass coin as argument and get price converted via btc-usdt rate
#ie. ./bq.sh enj
#requires bc and jq
echo `a=$1; A=$(echo $a | tr [a-z] [A-Z]);A=$(echo -n $A; echo -n BTC);curl -s https://api.binance.com/api/v3/ticker/price?symbol=$A | jq '.["price"]' | sed 's/"//g'`"*"`curl -s https://bittrex.com/api/v1.1/public/getticker?market=USDT-BTC | jq '.["result"]["Last"]' | awk '{ print sprintf("%.2f", $1); }'` | bc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment