This commit is contained in:
Bryan Ramos 2024-12-01 18:54:08 -05:00
parent 488d383637
commit 6bfd5d2047
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
price=$(curl -s "https://api.coinbase.com/v2/prices/spot?currency=USD" | jq -r .data.amount | awk -F. '{print $1}')
response=$(curl -s "https://api.coinbase.com/v2/prices/BTC-USD/spot")
price=$(echo "$response" | jq -r .data.amount | awk -F. '{print $1}')
if [ -z "$price" ]; then
echo -e "\033[31mErr\033[0m"