I’m publishing this module now, even though it’s not complete because I foresee not getting round to developing it much in the near future, and maybe others can benefit from it in its current state, or continue development.
What is EFA?
EFA is a product from Mentz Datenverarbeitung in Munich which is used my many municipal travel providers such as the MVV in Munich to provide travel data for their patrons.
Unfortunately there is no documentation to the interface available, so my implementation is mostly reverse-engineered to their RESTful API. A lot of ground work which helped me get ahead was done by Andreas and friends in Java with the public-transport-enabler (see AbstractEfaProvider in there for more details) which incidentally is the code behind the hugely popular android App Öffi.
What can I WWW::EFA for?
Querying travel times between locations, and stops within a municipal transport network.
Which municipalities will it work for?
There are loads of transport authorities which use EFA (London, Munich, Basel, San Francisco, …). I have only tested it with the MVV…
Where are all the unit tests and examples?
Sorry… it’s a work in progress… I’d be really grateful for any contributions you want to make to make it more complete!!
What other similar perl modules are there?
Code example
use WWW::EFA::Provider::MVV;
use WWW::EFA::Coordinates;
use WWW::EFA::Location;
use Class::Date qw/now/;
my %efa_params;
my $efa = WWW::EFA::Provider::MVV->new( %efa_params );
my $search_to_location = WWW::EFA::Location->new(
coordinates => WWW::EFA::Coordinates->new( lat => 48.171606, lon => 11.498899 ),
);
my $search_from_location = WWW::EFA::Location->new(
coordinates => WWW::EFA::Coordinates->new( lat => 48.140267, lon => 11.557302 ),
);
my( $from_location ) = $efa->coord_request(
location => $search_from_location,
max_results => 5,
max_distance => 100,
);
my( $to_location ) = $efa->coord_request(
location => $search_to_location,
max_results => 5,
max_distance => 100,
);
printf "##### Getting trips between\n%s\n%s\n",
$from_location->string, $to_location->string;
my $trips = $efa->trips(
from => $from_location,
to => $to_location,
date => now(),
);
print $trips->string;