Created
August 3, 2017 12:24
-
-
Save badpenguin/9f6236da5a65483e4373f2c6a70c5184 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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