From 664d686b0293fd8ba427d0aa9ea63ca7e75a938f Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 4 Aug 2026 19:57:29 +0200 Subject: swap long and lat in argument --- wetter | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wetter b/wetter index 0114305..6f5ac19 100755 --- a/wetter +++ b/wetter @@ -5,7 +5,7 @@ # wetter - client for api.weather.mg # # SYNOPSIS -# wetter [LONGITUDE,LATITUDE] +# wetter [LATITUDE,LONGITUDE] # # ENVIRONMENT # WETTER_CACHE_DIR (default: $XDG_CACHE_HOME/wetter or nothing) @@ -23,12 +23,12 @@ set -efu -# main [LONGITUDE,LATITUDE] +# main [LATITUDE,LONGITUDE] main() { - locatedAt=${WETTER_LOCATION-13.42013,52.51297} # default: c-base + location_spec=${WETTER_DEFAULT_LOCATION-52.51297,13.42013} # default: c-base if test $# = 1; then - locatedAt=$1 + location_spec=$1 fi token_url=${WETTER_TOKEN_URL-https://api.weatherpro.com/v1/token/weather} @@ -62,6 +62,8 @@ main() { join(",") ') + locatedAt=$(echo "$location_spec" | awk -F, '{print$2","$1}') + validFrom=$(date -d 'TZ="Europe/Berlin" - 48 hours' --utc +'%Y-%m-%dT%H:%M:%S.%3NZ') validUntil=$(date -d "TZ=\"Europe/Berlin\" + $(( 5 * 24 )) hours" --utc +'%Y-%m-%dT%H:%M:%S.%3NZ') -- cgit v1.3.1