initial commit
This commit is contained in:
commit
bb7048151f
7
README.md
Normal file
7
README.md
Normal 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
40196
stations.json
Normal file
File diff suppressed because it is too large
Load diff
10
when_my_bus.sh
Executable file
10
when_my_bus.sh
Executable 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"
|
Loading…
Reference in a new issue