Loading bin/efa-m +6 −6 Original line number Diff line number Diff line Loading @@ -224,12 +224,12 @@ sub display_result { for my $line (@lines) { if ( $edata{messages} and length( $line->[5] ) ) { $line->[5] =~ tr{\n\x0d}{ }s; chomp $line->[5]; if ( $edata{messages} and $line->[5] and @{ $line->[5] } ) { print "\n"; for my $info_line ( split( qr{\n}, $line->[5] ) ) { say "# ${info_line}"; for my $hint ( @{ $line->[5] } ) { $hint =~ tr{\n\x0d}{ }s; chomp $hint; say "# ${hint}"; } } Loading Loading @@ -342,7 +342,7 @@ sub show_results { } @output_line = ( $dtime, $platform, $line, q{}, $d->destination, $d->info ); = ( $dtime, $platform, $line, q{}, $d->destination, [ $d->hints ] ); if ( $edata{route} ) { $output_line[3] Loading lib/Travel/Status/DE/EFA.pm +4 −0 Original line number Diff line number Diff line Loading @@ -501,6 +501,9 @@ sub parse_departure { $departure->{stopID} ); } my @hints = map { $_->{content} } @{ $departure->{servingLine}{hints} // [] }; return Travel::Status::DE::EFA::Departure->new( rt_datetime => $real_dt, platform => $departure->{platform}, Loading @@ -518,6 +521,7 @@ sub parse_departure { sched_datetime => $sched_dt, type => $departure->{servingLine}{name}, mot => $departure->{servingLine}{motType}, hints => \@hints, prev_route => $prev_route, next_route => $next_route, ); Loading lib/Travel/Status/DE/EFA/Departure.pm +11 −6 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Departure->mk_ro_accessors( qw(countdown datetime delay destination is_cancelled info key line lineref qw(countdown datetime delay destination is_cancelled key line lineref mot occupancy operator origin platform platform_db platform_name rt_datetime sched_datetime train_type train_name train_no type) ); Loading Loading @@ -37,6 +37,12 @@ sub new { return bless( $ref, $obj ); } sub hints { my ($self) = @_; return @{ $self->{hints} // [] }; } sub mot_name { my ($self) = @_; Loading Loading @@ -171,12 +177,11 @@ indicates departure on time. undef when no realtime information is available. Destination name. =item $departure->info =item $departure->hints Additional information related to the departure (string). If departures for an address were requested, this is the stop name, otherwise it may be recent news related to the line's schedule. If no information is available, returns an empty string. Additional information related to the departure (list of strings). If departures for an address were requested, this is the stop name, otherwise it may be recent news related to the line's schedule. =item $departure->is_cancelled Loading Loading
bin/efa-m +6 −6 Original line number Diff line number Diff line Loading @@ -224,12 +224,12 @@ sub display_result { for my $line (@lines) { if ( $edata{messages} and length( $line->[5] ) ) { $line->[5] =~ tr{\n\x0d}{ }s; chomp $line->[5]; if ( $edata{messages} and $line->[5] and @{ $line->[5] } ) { print "\n"; for my $info_line ( split( qr{\n}, $line->[5] ) ) { say "# ${info_line}"; for my $hint ( @{ $line->[5] } ) { $hint =~ tr{\n\x0d}{ }s; chomp $hint; say "# ${hint}"; } } Loading Loading @@ -342,7 +342,7 @@ sub show_results { } @output_line = ( $dtime, $platform, $line, q{}, $d->destination, $d->info ); = ( $dtime, $platform, $line, q{}, $d->destination, [ $d->hints ] ); if ( $edata{route} ) { $output_line[3] Loading
lib/Travel/Status/DE/EFA.pm +4 −0 Original line number Diff line number Diff line Loading @@ -501,6 +501,9 @@ sub parse_departure { $departure->{stopID} ); } my @hints = map { $_->{content} } @{ $departure->{servingLine}{hints} // [] }; return Travel::Status::DE::EFA::Departure->new( rt_datetime => $real_dt, platform => $departure->{platform}, Loading @@ -518,6 +521,7 @@ sub parse_departure { sched_datetime => $sched_dt, type => $departure->{servingLine}{name}, mot => $departure->{servingLine}{motType}, hints => \@hints, prev_route => $prev_route, next_route => $next_route, ); Loading
lib/Travel/Status/DE/EFA/Departure.pm +11 −6 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Departure->mk_ro_accessors( qw(countdown datetime delay destination is_cancelled info key line lineref qw(countdown datetime delay destination is_cancelled key line lineref mot occupancy operator origin platform platform_db platform_name rt_datetime sched_datetime train_type train_name train_no type) ); Loading Loading @@ -37,6 +37,12 @@ sub new { return bless( $ref, $obj ); } sub hints { my ($self) = @_; return @{ $self->{hints} // [] }; } sub mot_name { my ($self) = @_; Loading Loading @@ -171,12 +177,11 @@ indicates departure on time. undef when no realtime information is available. Destination name. =item $departure->info =item $departure->hints Additional information related to the departure (string). If departures for an address were requested, this is the stop name, otherwise it may be recent news related to the line's schedule. If no information is available, returns an empty string. Additional information related to the departure (list of strings). If departures for an address were requested, this is the stop name, otherwise it may be recent news related to the line's schedule. =item $departure->is_cancelled Loading