Skip to content

Instantly share code, notes, and snippets.

@badpenguin
Created August 3, 2017 12:24
Show Gist options
  • Save badpenguin/9f6236da5a65483e4373f2c6a70c5184 to your computer and use it in GitHub Desktop.
Save badpenguin/9f6236da5a65483e4373f2c6a70c5184 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Space/Tab separated list of cryptocurrencies to query
CRYPTO="BTC ETH ZEC PPC"
# Fiat separated by comma
#FIAT="EUR,USD"
#FIAT="USD"
FIAT="EUR"
# Original endpoint URL
ENDPOINT=https://min-api.cryptocompare.com/data/price
# Loop crypto
for MN in $CRYPTO
do
URL="${ENDPOINT}?fsym=${MN}&tsyms=${FIAT}"
echo -n "${MN}: "
curl -s "$URL"
echo
done
#TODO: use "jq" to parse Json from bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment