update metar script
authorDan White <dan@whiteaudio.com>
Sat, 17 Dec 2016 22:45:24 +0000 (16:45 -0600)
committerDan White <dan@whiteaudio.com>
Sat, 17 Dec 2016 22:45:24 +0000 (16:45 -0600)
metar.sh

index bd142bcec309deacc0d0c6a0e318e3e3ef5940f6..f87fb1a2e90f52424e6fbc8528e0a2ef5c0ea591 100755 (executable)
--- a/metar.sh
+++ b/metar.sh
@@ -15,10 +15,15 @@ fi
 
 STATION=$1
 
+
 if [ $METAR -eq 1 ]; then
     # METAR
-    wget -q -O - http://weather.noaa.gov/mgetmetar.php?cccc=$STATION \
-        | grep -i $STATION \
+    #wget -q -O - http://weather.noaa.gov/mgetmetar.php?cccc=$STATION \
+        #| grep -i $STATION \
+        #| tail -1
+    addr="http://www.aviationweather.gov/metar/data?ids=$STATION&format=raw&hours=0&layout=0"
+    wget -q -O - $addr \
+        | grep -io "^$STATION[A-Za-z0-9 /]*" \
         | tail -1
 fi