hafas-m - Interface to the DeutscheBahn/HAFAS online departure monitor
hafas-m [-d date] [-t time] [-m motlist] [-s service] [-l language] station
hafas-m [-s service] ?query|lat:lon
hafas-m [-s service] [-l language] !query|journeyID
version 5.01
hafas-m is an interface to HAFAS arrival/departure monitors such as the one available at https://reiseauskunft.bahn.de//bin/bhftafel.exe/dn.
It has three operating modes that depend on the contents of its argument.
Show departures (or arrivals) at station, optionally filtered by date, time and mode of transport. station may be given as a station name or EVA ID. EVA IDs tend to be similar to, but not always identical with, UIC station codes. Output format:
Occupancy indicators are, from least occupied to fully booked: . o * !.
List stations that match query or that are located in the vicinity of lat:lon geocoordinates with EVA ID and name.
Show trip details (see below) for the train number provided in query (e.g. "ICE 205" or "S 31111") if it resolves into a single journey ID. Otherwise, list all journey IDs that match query.
List intermediate stops of journeyID with arrival/departure time, delay (if available), occupancy (if available), and stop name.
Show arrivals instead of departures, including trains ending at the specified station. Note that this causes the output to display the start instead of the end station.
Date to list departures for. Default: today.
Print result(s) as JSON and exit. This is a dump of internal data structures and not guaranteed to remain stable between minor versions. Please use the Travel::Status::DE::HAFAS(3pm) module if you need a proper API.
Request free-text messages to be provided in language. See --list for a list of languages supported by individual HAFAS instances. Note that requesting an invalid/unsupported language may lead to garbage output.
List known HAFAS installations and exit. Use -s|--service to select an operator from this list for a HAFAS request.
By default, hafas-m shows all modes of transport arriving/departing at the specified station. With motlist, it is possible to either exclude a list of modes, or exclusively show only a select list of modes.
To exclude modes, set motlist to !mot1,!mot2,...
To show them exclusively, set motlist to mot1,mot2,...
The mot types depend on the used service. Use -m help
to list them.
Print unprocessed HAFAS response as JSON and exit. Useful for debugging and development purposes.
Request arrivals/departures using the API provided by service, defaults to DB (Deutsche Bahn). See --list for a list of known services.
Time to list departures for. Default: now.
Only show departures that pass by stopname (or arivals that have passed by stopname). If stopname is given as a list of numeric EVA IDs, only arrivals/departures with an exact EVA ID match are shown. Otherwise stopname is treated as a regular expression and matched against stop names.
Show version information and exit.
0 upon success, 1 upon internal error, 2 upon backend error.
None.
The non-default services (anything other than DB) are not well-tested.
Copyright (C) 2015-2023 by Birte Kristina Friesel <derf@finalrewind.org>
This program is licensed under the same terms as Perl itself.