Skip to content

Instantly share code, notes, and snippets.

@camaleaun
Last active November 7, 2017 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camaleaun/05fc3853ae57ed073a5c9eec4ceb9ff8 to your computer and use it in GitHub Desktop.
Save camaleaun/05fc3853ae57ed073a5c9eec4ceb9ff8 to your computer and use it in GitHub Desktop.
Get temperatures from company of water service in São Bento do Sul SC - Brazil
#!/bin/bash
echo 'Temperatures in São Bento do Sul SC - Brazil'
CURL=$(curl -s http://www.samaesbs.sc.gov.br/)
NOW=$(echo $CURL | grep -oP 'temperatura\">\K([\d.]+)')
HIGH=$(echo $CURL | grep -oP '_max\">\K([\d.]+)')
LOW=$(echo $CURL | grep -oP '_min\">\K([\d.]+)')
echo " Now $NOWºC"
echo "High $HIGHºC"
echo " Low $LOWºC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment