From ae45ab865ce88ed4b26ee4bec03abdda7bde4dc9 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Tue, 4 Nov 2025 14:48:19 -0800 Subject: [PATCH] wttr: just use lat,lon for location Postal codes aren't globally unique. --- roles/wttr/files/wttr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/wttr/files/wttr.sh b/roles/wttr/files/wttr.sh index 272cfaf..11d260d 100755 --- a/roles/wttr/files/wttr.sh +++ b/roles/wttr/files/wttr.sh @@ -4,9 +4,9 @@ location="$1" if [ -z "$1" ]; then location_data=$(curl -s http://ip-api.com/json) - location=$(echo "$location_data" | jq -r 'if (.zip | length) != 0 then .zip else .city end') lat=$(echo "$location_data" | jq '.lat') lon=$(echo "$location_data" | jq '.lon') + location=$lat,$lon country=$(echo "$location_data" | jq -r '.country') fi