diff options
Diffstat (limited to 'nws')
| -rwxr-xr-x | nws | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -31,7 +31,10 @@ retrieve_counties() { get_location() { - cords=$(curl ipinfo.io/json | jq -r .loc) + file=$(curl ipinfo.io/json >> /tmp/nws/loc) + cords=$(jq -r '.loc' /tmp/nws/loc) + city=$(jq -r '.city' /tmp/nws/loc) + state=$(jq -r '.region' /tmp/nws/loc) } show_radar() { @@ -109,10 +112,14 @@ get_graphicast() { get_forecast() { colors + mkdir -p /tmp/nws/ get_location curl $(curl https://api.weather.gov/points/$cords | jq -r .properties.forecast) >> ~/.cache/.weather_forecast count=0 + echo length=$(echo $(jq '.properties.periods | length' ~/.cache/.weather_forecast) -1 | bc) + echo -e "Weather for ${GREEN}$city, $state${NOCOLOR}:" + echo while [ $count -le $length ] do echo ---------------------------------------------------------------------------------------------------- |