Make the new wttr script the default weather service. - annna - Annna the nice … | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 1c183bc2586613de9249a0e85cccbe017b6f6676 | |
parent ed8c895b2ab41895e7fe09f3a730b8f3f6cae51f | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 27 Aug 2023 09:17:28 +0200 | |
Make the new wttr script the default weather service. | |
Diffstat: | |
M weather | 21 ++++++--------------- | |
D wetter | 9 --------- | |
2 files changed, 6 insertions(+), 24 deletions(-) | |
--- | |
diff --git a/weather b/weather | |
@@ -1,18 +1,9 @@ | |
#!/bin/sh | |
-export PATH="/home/annna/bin:$PATH" | |
- | |
-if [ $# -lt 1 ]; | |
-then | |
- printf "usage: %s city/place\n" "$(basename "$0")" >&2 | |
- exit 1 | |
-fi | |
- | |
-place="$1" | |
-cityid="$(woob weather -b weather -q cities "${place}" 2>/dev/null \ | |
- | head -n 1 \ | |
- | cut -d' ' -f1)" | |
-[ $? -gt 0 ] && exit 1 | |
- | |
-woob weather -b weather -q current "${cityid}" 2>/dev/null | cut -d: -f2- | |
+[ -z "$1" ] && { | |
+ printf 'usage: %s <location>\n' "${0##*/}" >&2 | |
+ exit | |
+} | |
+location=$(printf %s "$1" | sed 's, ,\%20,g') | |
+curl -sfm 10 "https://wttr.in/$location?format=%C+%t\n" | |
diff --git a/wetter b/wetter | |
@@ -1,9 +0,0 @@ | |
-#!/bin/sh | |
- | |
-[ -z "$1" ] && { | |
- printf 'usage: %s <location>\n' "${0##*/}" >&2 | |
- exit | |
-} | |
- | |
-location=$(printf %s "$1" | sed 's, ,\%20,g') | |
-curl -sfm 10 "https://wttr.in/$location?format=%C+%t\n" |