Fixed logging
parent
38c3ebf383
commit
4b0f37165b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue