Loading bin/dbris +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Travel::Routing::DE::DBRIS; my ( $date, $time, $from, $to ); my $mots; my $discounts; my $developer_mode; my ( $json_output, $raw_json_output ); my $use_cache = 1; Loading @@ -33,6 +34,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{}; GetOptions( 'd|date=s' => \$date, 'D|discounts=s' => \$discounts, 'h|help' => sub { show_help(0) }, 'm|modes-of-transit=s' => \$mots, 't|time=s' => \$time, Loading Loading @@ -134,6 +136,10 @@ if ($mots) { $opt{modes_of_transit} = [ split( qr{, *}, $mots ) ]; } if ($discounts) { $opt{discounts} = [ split( qr{, *}, $discounts ) ]; } sub show_help { my ($code) = @_; Loading lib/Travel/Routing/DE/DBRIS.pm +26 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,32 @@ sub new { deutschlandTicketVorhanden => \0 }; if ( @{ $conf{discount} // [] } ) { $req->{reisende}[0]{ermaessigungen} = []; } for my $discount ( @{ $conf{discounts} // [] } ) { my ( $type, $class ); for my $num (qw(25 50 100)) { if ( $discount eq "bc${num}" ) { $type = "BAHNCARD${num}"; $class = 'KLASSE_2'; } elsif ( $discount eq "bc${num}-first" ) { $type = "BAHNCARD${num}"; $class = 'KLASSE_1'; } } if ($type) { push( @{ $req->{reisende}[0]{ermaessigungen} }, { art => $type, klasse => $class, } ); } } $self->{strptime_obj} //= DateTime::Format::Strptime->new( pattern => '%Y-%m-%dT%H:%M:%S', time_zone => 'Europe/Berlin', Loading Loading
bin/dbris +6 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ use Travel::Routing::DE::DBRIS; my ( $date, $time, $from, $to ); my $mots; my $discounts; my $developer_mode; my ( $json_output, $raw_json_output ); my $use_cache = 1; Loading @@ -33,6 +34,7 @@ my $output_reset = -t STDOUT ? "\033[0m" : q{}; GetOptions( 'd|date=s' => \$date, 'D|discounts=s' => \$discounts, 'h|help' => sub { show_help(0) }, 'm|modes-of-transit=s' => \$mots, 't|time=s' => \$time, Loading Loading @@ -134,6 +136,10 @@ if ($mots) { $opt{modes_of_transit} = [ split( qr{, *}, $mots ) ]; } if ($discounts) { $opt{discounts} = [ split( qr{, *}, $discounts ) ]; } sub show_help { my ($code) = @_; Loading
lib/Travel/Routing/DE/DBRIS.pm +26 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,32 @@ sub new { deutschlandTicketVorhanden => \0 }; if ( @{ $conf{discount} // [] } ) { $req->{reisende}[0]{ermaessigungen} = []; } for my $discount ( @{ $conf{discounts} // [] } ) { my ( $type, $class ); for my $num (qw(25 50 100)) { if ( $discount eq "bc${num}" ) { $type = "BAHNCARD${num}"; $class = 'KLASSE_2'; } elsif ( $discount eq "bc${num}-first" ) { $type = "BAHNCARD${num}"; $class = 'KLASSE_1'; } } if ($type) { push( @{ $req->{reisende}[0]{ermaessigungen} }, { art => $type, klasse => $class, } ); } } $self->{strptime_obj} //= DateTime::Format::Strptime->new( pattern => '%Y-%m-%dT%H:%M:%S', time_zone => 'Europe/Berlin', Loading