initial commit

This commit is contained in:
localhost_frssoft 2024-12-31 02:27:30 +03:00
commit bb7048151f
3 changed files with 40213 additions and 0 deletions

7
README.md Normal file
View file

@ -0,0 +1,7 @@
# Debloated tvercard stuff
cli fetching buses from https://tvercard.ru/raspisanie/
requirements:
bash, jq, fzf, curl
planned features:
* notifications when bus arrive soon to selected station

40196
stations.json Normal file

File diff suppressed because it is too large Load diff

10
when_my_bus.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
selected_station=$(cat stations.json | jq -r '.[] | "\(.station_id | tostring) \(.name) - \(.address)"' | fzf --bind 'enter:become(echo {1})')
fetch_buses_from_station() {
echo "Nearest buses from station $1:"
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=10" | jq .
}
export -f fetch_buses_from_station
watch --interval 5 -x bash -c "fetch_buses_from_station $selected_station"