Add weather script. It was missing. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 2cb8fb2d3209969a67283caee02cb052a1053c35 | |
parent 7033559aacd648aa495e2d81e4db47257cc7457f | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Wed, 9 Aug 2023 15:31:23 +0200 | |
Add weather script. It was missing. | |
Diffstat: | |
A weather | 18 ++++++++++++++++++ | |
1 file changed, 18 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/weather b/weather | |
@@ -0,0 +1,18 @@ | |
+#!/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- | |
+ |