Decoded METAR to bitreich-paste. - annna - Annna the nice friendly bot.
(HTM) git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 3f1c0bcdcea48977d1d277c74eb7c3329cb08986
(DIR) parent 914e54671c8a6a9998533063588547ddfe8258e2
(HTM) Author: eidolon <?>
Date: Fri, 11 Oct 2024 05:37:21 -0400
Decoded METAR to bitreich-paste.
Signed-off-by: Annna Robert-Houdin <annna@bitreich.org>
Diffstat:
M metar | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/metar b/metar
@@ -18,7 +18,7 @@ if [ "${#id}" = 3 ]; then
fi
fi
-fmt=raw
+fmt=decoded
uri="https://aviationweather.gov/api/data/metar/"
metar=$(curl -Ssfm 5 --data-urlencode format="$fmt" --data-urlencode ids="$id" "$uri")
@@ -27,4 +27,6 @@ if [ -z "$metar" ]; then
exit 1
fi
-printf '%s\n' "$metar"
+decodeuri=$(printf '%s\n' "$metar" | /br/bin/bitreich-paste)
+raw=$(printf '%s\n' "$metar" | sed -n '2s/^[^:]*: //p')
+printf '%s\n' "$raw ; decode: $decodeuri"