mirror of
https://github.com/pigmonkey/spark.git
synced 2026-01-23 02:24:09 +00:00
wttr: just use lat,lon for location
Postal codes aren't globally unique.
This commit is contained in:
parent
e720ded28d
commit
ae45ab865c
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue