hafas-m - Interface to the DeutscheBahn/HAFAS online departure monitor
hafas-m [-a] [-d date] [-t time] [-m motlist] [-v via] [-s service] [-l language] station
hafas-m [-s service] ?query|lat:lon
hafas-m [-s service] [-l language] !query|journeyID
version 6.14
hafas-m is an interface to HAFAS public transport services such as the one operated by Deutsche Bahn.
It can serve as an arrival/departure monitor, request details about a specific trip/journey, and look up public transport stops by name or geolocation. The operating mode depends on the contents of its non-option argument.
Show departures (or arrivals) at station, optionally filtered by mode of transport. station may be given as a station name or HAFAS station ID. For each train, hafas-m shows
Times are always given in the selected service's default time zone (see
--list). Times that differ from the queried stop's local time are marked
with *
. 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 (as given by arrival/departure monitor mode when invoked with -j, --with-jid) with arrival/departure time, delay (if available), occupancy (if available), and stop name. Also includes line/journey, operator, and heading information.
Times are reported in the selected HAFAS service's default time zone (typically Europe/Berlin). If a stop's local time differs, it is also provided.
Values in brackets indicate options that only apply to the corresponding operating mode(s).
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.
Request date. Default: today.
Show journey IDs in arrival/departure board. These can be used to obtain details on individual journeys with subsequent hafas-m invocations.
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 instances and exit. Use -s|--service to select a service 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.
Request up to count results. Default: 30.
If the Cache::File module is available, server replies are cached in
~/.cache/Travel-Status-DE-HAFAS (or a path relative to $XDG_CACHE_HOME
,
if set) for 90 seconds. Use this option to disable caching. You can also use
--cache to re-enable it.
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.
Request time. Must be specified in the selected HAFAS service's default time zone, see --list. 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.
Copyright (C) 2015-2023 by Birte Kristina Friesel <derf@finalrewind.org>
This program is licensed under the same terms as Perl itself.