Decoded METAR to bitreich-paste. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 3f1c0bcdcea48977d1d277c74eb7c3329cb08986 | |
parent 914e54671c8a6a9998533063588547ddfe8258e2 | |
Author: eidolon <?> | |
Date: Fri, 11 Oct 2024 05:37:21 -0400 | |
Decoded METAR to bitreich-paste. | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
M metar | 6 ++++-- | |
1 file changed, 4 insertions(+), 2 deletions(-) | |
--- | |
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"… | |
@@ -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" |