geo uri for mobile phone

This commit is contained in:
localhost_frssoft 2024-12-31 11:55:21 +03:00
parent 5dca1fb23e
commit 5d42dd2d72

View file

@ -4,7 +4,7 @@ selected_station=$(cat stations.json | jq -r '.[] | "\(.station_id | tostring) \
fetch_buses_from_station() {
echo "Nearest buses from station $1:"
cat stations.json | jq -r --arg id $1 'map(select(.station_id == ($id | tonumber))) | .[0] | "https://www.openstreetmap.org/?mlat=\(.lat)&mlon=\(.lng)#map=18/\(.lat)/\(.lng)"'
cat stations.json | jq -r --arg id $1 'map(select(.station_id == ($id | tonumber))) | .[0] | "https://www.openstreetmap.org/?mlat=\(.lat)&mlon=\(.lng)#map=18/\(.lat)/\(.lng)\ngeo:\(.lat),\(.lng)?z=18"'
curl -s -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:127.0) Gecko/20100101 Firefox/127.0' --compressed "https://api.merlin.tvercard.ru/api/client/v1/stations/$1/schedules/nearest?nearest_vehicle_amount=3" | jq -r '.[] | "\(.vehicle_arrival_time[].arrival_time) \(.vehicle_arrival_time[].arrival_time_comment) <- \(.route.name) \(.route.comment)"' | sort | uniq
}
export -f fetch_buses_from_station