Fixed logging

master
Keith Irwin 2022-05-07 10:40:55 -06:00
parent 38c3ebf383
commit 4b0f37165b
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ fi
for asset in ${!assets[@]}; do
echo "Checking $asset..."
url="https://api.polygon.io/v2/aggs/ticker/${assets[${asset}]}/prev?apiKey=${POLYGON_API_KEY}"
echo " URL: $url"
#echo " URL: $url"
res=$(curl --silent "$url")
# Check the result
@ -51,7 +51,7 @@ for asset in ${!assets[@]}; do
price=$(echo $res | jq '.results[0].vw')
echo " Price: $price"
line="P $(date -I --date=yesterday) $asset"
grep "$line" "$PRICES_FILE" \
grep "$line" "$PRICES_FILE" >/dev/null \
|| echo "$line \$$price" >> "$PRICES_FILE"
sleep 10 # Optional, check API limits
fi