Loading bin/efa-m +8 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use Getopt::Long qw(:config no_ignore_case); use List::Util qw(max); use Travel::Status::DE::VRR; my ( $date, $time ); my ( $date, $time, $input_type ); my @output; binmode( STDOUT, ':encoding(utf-8)' ); Loading @@ -26,13 +26,18 @@ if ( @ARGV != 2 ) { show_help(1); } my ( $place, $station ) = @ARGV; my ( $place, $input ) = @ARGV; if ( $input =~ s{ ^ (?<type> address|poi|stop) : }{}x ) { $input_type = $+{type}; } my $status = Travel::Status::DE::VRR->new( date => $date, place => $place, name => $station, name => $input, time => $time, type => $input_type, ); sub show_help { Loading lib/Travel/Status/DE/VRR.pm +15 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ sub new { my $mech = WWW::Mechanize->new(); my @now = localtime( time() ); if ( not( $opt{place} and $opt{name} ) ) { confess('You need to specify a place and a name'); } if ( $opt{type} and not( $opt{type} ~~ [qw[stop address poi]] ) ) { confess('type must be stop, address or poi'); } my $self = { post => { command => q{}, Loading Loading @@ -46,7 +53,7 @@ sub new { sessionID => '0', submitButton => 'anfordern', typeInfo_dm => 'invalid', type_dm => 'stop', type_dm => $opt{type} // 'stop', useProxFootSearch => '0', useRealtime => '1', }, Loading Loading @@ -170,10 +177,14 @@ Arguments: Name of the place/city =item B<name> => I<stop name> =item B<type> => B<address>|B<poi>|B<stop> Type of the following I<name>. B<poi> means "point of interest". Defaults to B<stop> (stop/station name). =item B<name> => I<name> Name of the stop to list departures for. In future versions, this may also support street or poi ("point of interest") names address / poi / stop name to list departures for. =back Loading Loading
bin/efa-m +8 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use Getopt::Long qw(:config no_ignore_case); use List::Util qw(max); use Travel::Status::DE::VRR; my ( $date, $time ); my ( $date, $time, $input_type ); my @output; binmode( STDOUT, ':encoding(utf-8)' ); Loading @@ -26,13 +26,18 @@ if ( @ARGV != 2 ) { show_help(1); } my ( $place, $station ) = @ARGV; my ( $place, $input ) = @ARGV; if ( $input =~ s{ ^ (?<type> address|poi|stop) : }{}x ) { $input_type = $+{type}; } my $status = Travel::Status::DE::VRR->new( date => $date, place => $place, name => $station, name => $input, time => $time, type => $input_type, ); sub show_help { Loading
lib/Travel/Status/DE/VRR.pm +15 −4 Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ sub new { my $mech = WWW::Mechanize->new(); my @now = localtime( time() ); if ( not( $opt{place} and $opt{name} ) ) { confess('You need to specify a place and a name'); } if ( $opt{type} and not( $opt{type} ~~ [qw[stop address poi]] ) ) { confess('type must be stop, address or poi'); } my $self = { post => { command => q{}, Loading Loading @@ -46,7 +53,7 @@ sub new { sessionID => '0', submitButton => 'anfordern', typeInfo_dm => 'invalid', type_dm => 'stop', type_dm => $opt{type} // 'stop', useProxFootSearch => '0', useRealtime => '1', }, Loading Loading @@ -170,10 +177,14 @@ Arguments: Name of the place/city =item B<name> => I<stop name> =item B<type> => B<address>|B<poi>|B<stop> Type of the following I<name>. B<poi> means "point of interest". Defaults to B<stop> (stop/station name). =item B<name> => I<name> Name of the stop to list departures for. In future versions, this may also support street or poi ("point of interest") names address / poi / stop name to list departures for. =back Loading