diff --git a/when_my_bus.sh b/when_my_bus.sh index 9c2c126..22bf715 100755 --- a/when_my_bus.sh +++ b/when_my_bus.sh @@ -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