Loading bin/efa-m +12 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,16 @@ sub display_result { } for my $line (@lines) { if ( length( $line->[4] ) ) { $line->[4] =~ tr{\n\x0d}{ }s; chomp $line->[4]; print "\n"; for my $info_line ( split( qr{\n}, $line->[4] ) ) { say "# ${info_line}"; } } printf( join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n", @{$line}[ 0 .. 3 ] Loading @@ -75,7 +85,8 @@ sub display_result { for my $d ( $status->results ) { push( @output, [ $d->time, $d->platform, $d->line, $d->destination, ] ); push( @output, [ $d->time, $d->platform, $d->line, $d->destination, $d->info ] ); } display_result(@output); Loading lib/Travel/Status/DE/VRR.pm +4 −1 Original line number Diff line number Diff line Loading @@ -94,14 +94,16 @@ sub results { [ 'platform', './td[3]' ], [ 'line', './td[5]' ], [ 'dest', './td[7]' ], [ 'info', './td[9]' ], ); @parts = map { [ $_->[0], XML::LibXML::XPathExpression->new( $_->[1] ) ] } @parts; for my $tr ( $self->{tree}->findnodes($xp_element) ) { my ( $time, $platform, $line, $dest ) my ( $time, $platform, $line, $dest, $info ) = map { ( $tr->findnodes( $_->[1] ) )[0]->textContent } @parts; push( @results, Travel::Status::DE::VRR::Result->new( Loading @@ -109,6 +111,7 @@ sub results { platform => $platform, line => $line, destination => $dest, info => $info, ) ); } Loading lib/Travel/Status/DE/VRR/Result.pm +7 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.00'; Travel::Status::DE::VRR::Result->mk_ro_accessors( qw(destination time platform line)); qw(destination time platform line info)); sub new { my ( $obj, %conf ) = @_; Loading Loading @@ -57,6 +57,12 @@ line number and destination. The tram/bus/train destination. =item $departure->info 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. =item $departure->line The name/number of the line. Loading Loading
bin/efa-m +12 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,16 @@ sub display_result { } for my $line (@lines) { if ( length( $line->[4] ) ) { $line->[4] =~ tr{\n\x0d}{ }s; chomp $line->[4]; print "\n"; for my $info_line ( split( qr{\n}, $line->[4] ) ) { say "# ${info_line}"; } } printf( join( q{ }, ( map { "%-${_}s" } @line_length ) ) . "\n", @{$line}[ 0 .. 3 ] Loading @@ -75,7 +85,8 @@ sub display_result { for my $d ( $status->results ) { push( @output, [ $d->time, $d->platform, $d->line, $d->destination, ] ); push( @output, [ $d->time, $d->platform, $d->line, $d->destination, $d->info ] ); } display_result(@output); Loading
lib/Travel/Status/DE/VRR.pm +4 −1 Original line number Diff line number Diff line Loading @@ -94,14 +94,16 @@ sub results { [ 'platform', './td[3]' ], [ 'line', './td[5]' ], [ 'dest', './td[7]' ], [ 'info', './td[9]' ], ); @parts = map { [ $_->[0], XML::LibXML::XPathExpression->new( $_->[1] ) ] } @parts; for my $tr ( $self->{tree}->findnodes($xp_element) ) { my ( $time, $platform, $line, $dest ) my ( $time, $platform, $line, $dest, $info ) = map { ( $tr->findnodes( $_->[1] ) )[0]->textContent } @parts; push( @results, Travel::Status::DE::VRR::Result->new( Loading @@ -109,6 +111,7 @@ sub results { platform => $platform, line => $line, destination => $dest, info => $info, ) ); } Loading
lib/Travel/Status/DE/VRR/Result.pm +7 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.00'; Travel::Status::DE::VRR::Result->mk_ro_accessors( qw(destination time platform line)); qw(destination time platform line info)); sub new { my ( $obj, %conf ) = @_; Loading Loading @@ -57,6 +57,12 @@ line number and destination. The tram/bus/train destination. =item $departure->info 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. =item $departure->line The name/number of the line. Loading