Created
January 31, 2022 13:36
-
-
Save kzzzr/d466ad1ca815f39bbfd92fa9d5fe25c8 to your computer and use it in GitHub Desktop.
Fetching exchange rates
This file contains 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
## Enable debugging messages and exit on error | |
# set -ex | |
## Assign variables directly or use ENV variables | |
TS=`date +"%Y-%m-%d-%H-%M-%S-%Z"` | |
# OXR_TOKEN='' | |
# BASE_CURRENCY='RUB' | |
# SYMBOLS='AED,EUR,GBP,RUB,USD' | |
## Chain commands | |
curl -H "Authorization: Token $OXR_TOKEN" \ | |
"https://openexchangerates.org/api/historical/$BUSINESS_DT.json?base=$BASE_CURRENCY&symbols=$SYMBOLS" \ | |
| aws s3 cp - s3://$BUCKET/$BUCKET_PATH/$BUSINESS_DT-$BASE_CURRENCY-$TS.json | |
## Print log messages | |
echo "FETCHED s3://$BUCKET/$BUCKET_PATH/$BUSINESS_DT-$BASE_CURRENCY-$TS.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment