dotfiles/.local/bin/scripts/geocode

9 lines
309 B
Plaintext
Raw Normal View History

2022-10-13 19:55:59 +00:00
#!/bin/sh -e
endpoint='https://photon.komoot.io'
lsof -i :2322 >/dev/null && endpoint='http://localhost:2322'
location=$(echo "$@" | sed 's| |%20|g')
echo "Geocoding $location" >&2
curl "$endpoint/api/?q=$location&lang=de&limit=1" | jq
# Germany: &bbox=5.98865807458,47.3024876979,15.0169958839,54.983104153