Loading bin/efa-m +7 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,13 @@ sub show_coord { } } sub show_stopfinder { my $max_len = max map { length( $_->full_name ) } $efa->results; for my $stop ( $efa->results ) { printf( "%-${max_len}s %s\n", $stop->full_name, $stop->id ); } } sub show_stopseq { my $trip = $efa->result; Loading lib/Travel/Status/DE/EFA.pm +27 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ sub new { $self->{post} = { locationServerActive => 1, type_sf => 'any', name => $opt{stopfinder}{name}, name_sf => $opt{stopfinder}{name}, anyObjFilter_sf => 2, coordOutputFormat => 'WGS84[DD.DDDDD]', outputFormat => 'JSON', Loading Loading @@ -536,6 +536,9 @@ sub results { if ( $self->{post}{coord} ) { return $self->results_coord; } elsif ( $self->{post}{name_sf} ) { return $self->results_stopfinder; } else { return $self->results_dm; } Loading Loading @@ -564,6 +567,29 @@ sub results_coord { return @results; } sub results_stopfinder { my ($self) = @_; my $json = $self->{response}; my @results; for my $stop ( @{ $json->{stopFinder}{points} // [] } ) { push( @results, Travel::Status::DE::EFA::Stop->new( place => $stop->{ref}{place}, full_name => $stop->{name}, name => $stop->{object}, id => $stop->{stateless}, stop_id => $stop->{ref}{gid}, ) ); } $self->{results} = \@results; return @results; } sub results_dm { my ($self) = @_; my $json = $self->{response}; Loading Loading
bin/efa-m +7 −0 Original line number Diff line number Diff line Loading @@ -325,6 +325,13 @@ sub show_coord { } } sub show_stopfinder { my $max_len = max map { length( $_->full_name ) } $efa->results; for my $stop ( $efa->results ) { printf( "%-${max_len}s %s\n", $stop->full_name, $stop->id ); } } sub show_stopseq { my $trip = $efa->result; Loading
lib/Travel/Status/DE/EFA.pm +27 −1 Original line number Diff line number Diff line Loading @@ -192,7 +192,7 @@ sub new { $self->{post} = { locationServerActive => 1, type_sf => 'any', name => $opt{stopfinder}{name}, name_sf => $opt{stopfinder}{name}, anyObjFilter_sf => 2, coordOutputFormat => 'WGS84[DD.DDDDD]', outputFormat => 'JSON', Loading Loading @@ -536,6 +536,9 @@ sub results { if ( $self->{post}{coord} ) { return $self->results_coord; } elsif ( $self->{post}{name_sf} ) { return $self->results_stopfinder; } else { return $self->results_dm; } Loading Loading @@ -564,6 +567,29 @@ sub results_coord { return @results; } sub results_stopfinder { my ($self) = @_; my $json = $self->{response}; my @results; for my $stop ( @{ $json->{stopFinder}{points} // [] } ) { push( @results, Travel::Status::DE::EFA::Stop->new( place => $stop->{ref}{place}, full_name => $stop->{name}, name => $stop->{object}, id => $stop->{stateless}, stop_id => $stop->{ref}{gid}, ) ); } $self->{results} = \@results; return @results; } sub results_dm { my ($self) = @_; my $json = $self->{response}; Loading