Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
arikkfir committed Dec 18, 2024
1 parent 5c3e044 commit ab204b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/update-exchange-rates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ jobs:
for c in "${CURRENCIES[@]}"; do
curl -sSL "https://api.polygon.io/v2/aggs/ticker/C:${c}USD/range/1/day/${THIS_YEAR_START_DATE}/${THIS_YEAR_END_DATE}?apiKey=${POLYGON_KEY}" \
| jq -r ".results[] | [ (.t / 1000 | strftime(\"%Y-%m-%d\")), \"${c}\", \"USD\", .c, \"false\" ]|@csv" >> "./deploy/local/rates/exchange-rates.csv"
sleep 6
sleep 12
done
LAST_YEAR="$(date -d "1 years ago" +"%Y")"
for year in $(seq ${LAST_YEAR} -1 2000); do
for c in "${CURRENCIES[@]}"; do
curl -sSL "https://api.polygon.io/v2/aggs/ticker/C:${c}USD/range/1/day/${year}-01-01/${year}-12-31?apiKey=${POLYGON_KEY}" \
| jq -r ".results[] | [ (.t / 1000 | strftime(\"%Y-%m-%d\")), \"${c}\", \"USD\", .c, \"false\" ]|@csv" >> "./deploy/local/rates/exchange-rates.csv"
sleep 6
sleep 12
done
done
Expand Down

0 comments on commit ab204b9

Please sign in to comment.