Loading bin/dbris-m +10 −3 Original line number Diff line number Diff line Loading @@ -149,10 +149,17 @@ if ($json_output) { if ( $opt{station} ) { my $max_line = max map { length( $_->line ) } $status->results; my $max_dest = max map { length( $_->dest_name ) } $status->results; my $max_delay = max map { length( $_->delay // q{} ) } $status->results; $max_delay += 1; for my $result ( $status->results ) { printf( "%s %${max_line}s %${max_dest}s %s\n", "%s %s %${max_line}s %${max_dest}s %s\n", $result->is_cancelled ? '--:--' : $result->dep->strftime('%H:%M'), $result->delay ? sprintf( "(%+${max_delay}d)", $result->delay ) : q{ } x ( $max_delay + 2 ), $result->line, $result->dest_name, $result->platform // $result->sched_platform Loading lib/Travel/Status/DE/DBRIS.pm +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ sub new { if ( my $eva = $conf{station} ) { $req = "https://www.bahnhof.de/api/boards/departures?evaNumbers=${eva}&duration=60&stationCategory=1&locale=de&sortBy=TIME_SCHEDULE"; = "https://www.bahnhof.de/api/boards/departures?evaNumbers=${eva}&duration=60&stationCategory=1&locale=de&sortBy=TIME"; } elsif ( my $gs = $conf{geoSearch} ) { my $lat = $gs->{latitude}; Loading lib/Travel/Status/DE/DBRIS/Journey.pm +6 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( qw(type dep sched_dep rt_dep is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) qw(type dep sched_dep rt_dep delay is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) ); sub new { Loading Loading @@ -40,6 +40,11 @@ sub new { } $ref->{dep} = $ref->{rt_dep} // $ref->{schd_dep}; if ( $ref->{sched_dep} and $ref->{rt_dep} ) { $ref->{delay} = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) ->in_units('minutes'); } return $ref; } Loading Loading
bin/dbris-m +10 −3 Original line number Diff line number Diff line Loading @@ -149,10 +149,17 @@ if ($json_output) { if ( $opt{station} ) { my $max_line = max map { length( $_->line ) } $status->results; my $max_dest = max map { length( $_->dest_name ) } $status->results; my $max_delay = max map { length( $_->delay // q{} ) } $status->results; $max_delay += 1; for my $result ( $status->results ) { printf( "%s %${max_line}s %${max_dest}s %s\n", "%s %s %${max_line}s %${max_dest}s %s\n", $result->is_cancelled ? '--:--' : $result->dep->strftime('%H:%M'), $result->delay ? sprintf( "(%+${max_delay}d)", $result->delay ) : q{ } x ( $max_delay + 2 ), $result->line, $result->dest_name, $result->platform // $result->sched_platform Loading
lib/Travel/Status/DE/DBRIS.pm +1 −1 Original line number Diff line number Diff line Loading @@ -50,7 +50,7 @@ sub new { if ( my $eva = $conf{station} ) { $req = "https://www.bahnhof.de/api/boards/departures?evaNumbers=${eva}&duration=60&stationCategory=1&locale=de&sortBy=TIME_SCHEDULE"; = "https://www.bahnhof.de/api/boards/departures?evaNumbers=${eva}&duration=60&stationCategory=1&locale=de&sortBy=TIME"; } elsif ( my $gs = $conf{geoSearch} ) { my $lat = $gs->{latitude}; Loading
lib/Travel/Status/DE/DBRIS/Journey.pm +6 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( qw(type dep sched_dep rt_dep is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) qw(type dep sched_dep rt_dep delay is_cancelled line stop_name stop_eva id admin_id journey_id sched_platform platform dest_name dest_eva route) ); sub new { Loading Loading @@ -40,6 +40,11 @@ sub new { } $ref->{dep} = $ref->{rt_dep} // $ref->{schd_dep}; if ( $ref->{sched_dep} and $ref->{rt_dep} ) { $ref->{delay} = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) ->in_units('minutes'); } return $ref; } Loading