Created
September 13, 2024 17:46
-
-
Save rafaell-lycan/84f6f16d2e564ed39c0deb5694dd2011 to your computer and use it in GitHub Desktop.
Cotacão.sh
This file contains hidden or 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
#!/usr/bin/env bash | |
HEADER="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox\/81.0" | |
SITES=( | |
"https://dolarhoje.com" | |
"https://dolarhoje.com/euro-hoje/" | |
"https://dolarhoje.com/libra-hoje/" | |
"https://dolarhoje.com/bitcoin-hoje/" | |
) | |
while : ; do | |
for site in ${SITES[@]}; do | |
COMMAND=$(curl -s -A "$HEADER" $site | egrep "id=\"nacional\"" | sed 's/<div.*value=//;s/\/>.*//;s/"//g;s/ //g') | |
case $site in | |
https://dolarhoje.com) | |
echo "DOLAR -> R\$$COMMAND" | |
;; | |
https://dolarhoje.com/euro-hoje/) | |
echo "EURO -> R\$$COMMAND" | |
;; | |
https://dolarhoje.com/libra-hoje/) | |
echo "LIBRA -> R\$$COMMAND" | |
;; | |
https://dolarhoje.com/bitcoin-hoje/) | |
echo "BITCOIN -> R\$$COMMAND" | |
;; | |
esac | |
done | |
sleep 43200 | |
clear | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment