2
0
Fork 0
mirror of https://github.com/alexanderepstein/Bash-Snippets synced 2018-11-08 02:59:35 +01:00

Fixing issue where weather would not find the location

In a state such as conencticut with a shortned name CT it doesnt work to grab the first two letters CO.
This commit is contained in:
Alex Epstein 2018-01-02 19:20:26 -05:00
parent 0e24bf81f0
commit c60f888b32

View file

@ -43,8 +43,6 @@ getIPWeather()
region=$(httpGet ipinfo.io/region) > /dev/null
if [[ $(echo $region | wc -w) == 2 ]];then
region=$(echo $region | grep -Eo "[A-Z]*" | tr -d "[:space:]")
else
region=$(echo "$region" | cut -c "1-2" | tr "[:lower:]" "[:upper:]")
fi
httpGet $locale.wttr.in/$city,$region$1
else ## otherwise we are going to use longitude and latitude