aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/metar
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2020-02-05 16:09:27 -0500
committerBen Burwell <ben@benburwell.com>2020-02-05 16:09:27 -0500
commita42ca5340be6dc92a744fc19a0aa27c60b5c57ea (patch)
treea7856997f174b4a46691b20ab453b252a10d16fc /templates/.bin/metar
parent9292ff0f514eb6e17234f25a0418dc2a742c605a (diff)
metar/taf: update avwx api
Diffstat (limited to 'templates/.bin/metar')
-rwxr-xr-xtemplates/.bin/metar7
1 files changed, 4 insertions, 3 deletions
diff --git a/templates/.bin/metar b/templates/.bin/metar
index a9d7429..e81a028 100755
--- a/templates/.bin/metar
+++ b/templates/.bin/metar
@@ -21,9 +21,10 @@ while [ $# -gt 0 ]; do
esac
shift
done
-json=$(curl -s "https://avwx.rest/api/metar/${station:-KBOS}?options=speech")
+token=$(pass show avwx-token)
+json=$(curl -s -H "Authorization: ${token}" "https://avwx.rest/api/metar/${station:-KBOS}?options=speech")
if [ $say -gt 0 ]; then
- echo "$json" | "$jq" --raw-output '.Speech' 2>&1 | say
+ echo "$json" | "$jq" --raw-output '.speech' 2>&1 | say
else
- echo "$json" | "$jq" --raw-output '.["Raw-Report"]' 2>&1
+ echo "$json" | "$jq" --raw-output '.raw' 2>&1
fi