summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2023-10-28 19:15:59 +0100
committerLuke Bratch <luke@bratch.co.uk>2023-10-28 19:15:59 +0100
commitbe17c46b945d3d4a3f31186eb8f5bc66173a4abb (patch)
tree69b37c4815fe30d091ff2d1e78485d786495770b
parentcab85771bb4054e1c020c4cd9ccac1363268a28d (diff)
Update aviationweather.gov download method.HEADmaster
-rwxr-xr-xmetar.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/metar.sh b/metar.sh
index 599d57f..14b71e0 100755
--- a/metar.sh
+++ b/metar.sh
@@ -10,7 +10,7 @@ fi
ICAO="$(echo "$ICAO" | tr "a-z" "A-Z")"
# aviationweather.gov
-result1="$(xmllint --xpath 'string(/response/data/METAR/raw_text)' <(curl -s "https://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&stationString=$ICAO&hoursBeforeNow=1") | head -n1)"
+result1="$(curl -s https://aviationweather.gov/cgi-bin/data/metar.php?ids=$ICAO)"
# metar-taf.com
result2="$(curl -s "https://metar-taf.com/history/$ICAO" | grep -E "METAR $ICAO [0-9]{6}Z" | head -n1 | sed "s/^\s*METAR // ; s|</td>|| ; s/\s*$//")"