Loading bin/efa-m +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Travel::Status::DE::EFA; my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST'; my ( $date, $time, $input_type, $list_lines, $offset, $relative_times ); my ($timeout); my ( @grep_lines, @grep_platforms ); @ARGV = map { decode( 'UTF-8', $_ ) } @ARGV; Loading @@ -29,6 +30,7 @@ GetOptions( 'p|platform=s@' => \@grep_platforms, 'r|relative' => \$relative_times, 't|time=s' => \$time, 'timeout=i' => \$timeout, 'u|efa-url=s' => \$efa_url, 'V|version' => \&show_version, Loading @@ -55,6 +57,7 @@ my $status = Travel::Status::DE::EFA->new( name => $input, time => $time, type => $input_type, timeout => $timeout // 10, ); sub show_help { Loading lib/Travel/Status/DE/EFA.pm +13 −3 Original line number Diff line number Diff line Loading @@ -114,7 +114,9 @@ sub new { $self->{xml} = $response->decoded_content; $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); #say $self->{tree}->toString(1); Loading @@ -126,9 +128,13 @@ sub new { sub new_from_xml { my ( $class, %opt ) = @_; my $self = { xml => $opt{xml}, }; my $self = { xml => $opt{xml}, }; $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); return bless( $self, $class ); } Loading Loading @@ -277,6 +283,10 @@ sub results { my ($self) = @_; my @results; if ( not $self->{tree} ) { return; } my $xp_element = XML::LibXML::XPathExpression->new('//itdDeparture'); my $xp_date = XML::LibXML::XPathExpression->new('./itdDateTime/itdDate'); Loading Loading
bin/efa-m +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Travel::Status::DE::EFA; my $efa_url = 'http://efa.vrr.de/vrr/XSLT_DM_REQUEST'; my ( $date, $time, $input_type, $list_lines, $offset, $relative_times ); my ($timeout); my ( @grep_lines, @grep_platforms ); @ARGV = map { decode( 'UTF-8', $_ ) } @ARGV; Loading @@ -29,6 +30,7 @@ GetOptions( 'p|platform=s@' => \@grep_platforms, 'r|relative' => \$relative_times, 't|time=s' => \$time, 'timeout=i' => \$timeout, 'u|efa-url=s' => \$efa_url, 'V|version' => \&show_version, Loading @@ -55,6 +57,7 @@ my $status = Travel::Status::DE::EFA->new( name => $input, time => $time, type => $input_type, timeout => $timeout // 10, ); sub show_help { Loading
lib/Travel/Status/DE/EFA.pm +13 −3 Original line number Diff line number Diff line Loading @@ -114,7 +114,9 @@ sub new { $self->{xml} = $response->decoded_content; $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); #say $self->{tree}->toString(1); Loading @@ -126,9 +128,13 @@ sub new { sub new_from_xml { my ( $class, %opt ) = @_; my $self = { xml => $opt{xml}, }; my $self = { xml => $opt{xml}, }; $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); $self->{tree} = XML::LibXML->load_xml( string => $self->{xml}, ); return bless( $self, $class ); } Loading Loading @@ -277,6 +283,10 @@ sub results { my ($self) = @_; my @results; if ( not $self->{tree} ) { return; } my $xp_element = XML::LibXML::XPathExpression->new('//itdDeparture'); my $xp_date = XML::LibXML::XPathExpression->new('./itdDateTime/itdDate'); Loading