Simple command line tool that give u an x amount of departures from a train station to a another one, to arrive at a certain time.
It works completely config based, but all parameters should also be able to be passed via command line. Command Line arguments will always override config arguments.
It is basically a simple wrapper of the hafas-client, that introduces a config base cli tool, and has the ability to start a rest server that accepts configs as payload.
example/default
{
"config": "check-bvg.config.json",
"start": "S+U Alexanderplatz",
"end": "S Hackescher Markt",
"arrivalTime": "8:00",
"resultAmount": 3,
"server": false,
"port": 3000
}
check-bvg -c ./check-bvg.config.json --resultAmount 5
Usage: check-bvg [options]
Options:
- -V, --version output the version number
- -C, --config <path> Path to config
- -S, --start <start-station> Name of the station where the journey starts
- -E, --end <end-station> Name of the station where the journey ends
- -A, --arrivalTime <time> Time where you want to arrive at the end station
- -R, --resultAmount <amount> Amount of results the script should return
- --server Sets up a server that responds to rest requests
- -P, --port <port> Defines the port of the server
- -h, --help display help for command
journey endpoint
POST /api/v1/journey
Payload is basically a config object.
I am using this script personally to get the 3 latest trains I have to catch every morning. The results will later be used by another service.
[ ] Parings Dates as AM/PM