Add weather script. It was missing. - 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 2cb8fb2d3209969a67283caee02cb052a1053c35
(DIR) parent 7033559aacd648aa495e2d81e4db47257cc7457f
(HTM) Author: Annna Robert-Houdin <annna@bitreich.org>
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(-)
---
(DIR) 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-
+