initial commit
[weeklyforecast] / weeklyforecast
1 #!/bin/bash
2 if [ -z $1 ]; then
3         zone="INZ004"
4 else
5         zone="$1"
6 zone=${zone^^}
7 fi
8
9 a="zonecodes.txt"
10
11 if grep -qwF "$zone" "$a"; then
12 echo "Weekly Forecast for $zone"
13 curl -s -X GET "https://api.weather.gov/zones/ZFP/$zone/forecast" -H  "accept: application/ld+json" | jq -r '.periods[] | .name, .detailedForecast'
14
15 else
16         echo "Zone code invalid"
17
18 fi