Travel::Routing::DE::VRR - unofficial interface to the efa.vrr.de German itinerary service
use Travel::Routing::DE::VRR; my $efa = Travel::Routing::DE::VRR->new( origin => [ 'Essen', 'HBf' ], destination => [ 'Duisburg', 'HBf' ], ); for my $route ( $efa->routes ) { for my $part ( $route->parts ) { printf( "%s at %s -> %s at %s, via %s to %s", $part->departure_time, $part->departure_stop, $part->arrival_time, $part->arrival_stop, $part->train_line, $part->train_destination, ); } print "\n\n"; }
version 2.04
Travel::Routing::DE::VRR is a client for the efa.vrr.de web interface. You pass it the start/stop of your journey, maybe a time and a date and more details, and it returns the up-to-date scheduled connections between those two stops.
It uses LWP::UserAgent and XML::LibXML for this.
Returns a new Travel::Routing::DE::VRR object and sets up its POST data via %opts.
Valid hash keys and their values are:
Mandatory. Sets the start of the journey. type is optional and may be one of stop (default), address (street and house number) or poi ("point of interest").
Mandatory. Sets the end of the journey, see origin.
Optional. Specifies an intermediate stop which the resulting itinerary must contain. See origin for arguments.
Journey end time
Journey start time. Default: now
Journey date. Default: tdoay
Do not use certain transport types for itinerary. Accepted arguments: zug, s-bahn, u-bahn, stadtbahn, tram, stadtbus, regionalbus, schnellbus, seilbahn, schiff, ast, sonstige
Set maximum number of interchanges
Prefer either fast connections (default), connections with low wait time or connections with little distance to walk
If true: Try using near stops instead of the specified origin/destination ones
Include only local trains into itinarery (default), all but ICEs, or all.
The latter two are usually way more expensive for short routes.
Set walk speed. Default: normal
If true: Prefer connections allowing passengers with bikes
Options to pass to LWP::UserAgent->new.
LWP::UserAgent->new
By default, new will create a POST request and submit it to http://efa.vrr.de. If you do not want it to be submitted yet, set this to 0.
Submit the query to http://efa.vrr.de. %opts is passed on to LWP::UserAgent->new.
Returns a list of Travel::Routing::DE::VRR::Route(3pm) elements. Each one contains one method of getting from start to stop.
The following methods act like the arguments to new. See there.
When encountering an error, Travel::Routing::DE::VRR throws a Travel::Routing::DE::VRR::Exception(3pm) object.
LWP::UserAgent(3pm)
XML::LibXML(3pm)
None known.
Travel::Routing::DE::VRR::Exception(3pm)
Travel::Routing::DE::VRR::Route(3pm)
WWW::EFA is another implementation, using Moose.
Copyright (C) 2009-2014 by Daniel Friesel <derf@finalrewind.org>
0. You just DO WHAT THE FUCK YOU WANT TO.
To install Travel::Routing::DE::VRR, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Travel::Routing::DE::VRR
CPAN shell
perl -MCPAN -e shell install Travel::Routing::DE::VRR
For more information on module installation, please visit the detailed CPAN module installation guide.