Loading bin/dbris-m +15 −9 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use List::Util qw(max); use Travel::Status::DE::DBRIS; my ( $date, $time ); my $mots; my $developer_mode; my $show_jid; my $use_cache = 1; Loading @@ -34,6 +35,7 @@ GetOptions( 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'j|with-jid' => \$show_jid, 'm|modes-of-transit=s' => \$mots, 't|time=s' => \$time, 'V|version' => \&show_version, 'cache!' => \$use_cache, Loading Loading @@ -140,6 +142,10 @@ if ( $date or $time ) { $opt{datetime} = $dt; } if ($mots) { $opt{modes_of_transit} = [ split( qr{, *}, $mots ) ]; } my $status = Travel::Status::DE::DBRIS->new(%opt); sub show_help { Loading lib/Travel/Status/DE/DBRIS.pm +11 −6 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ sub new { if ( my $station = $conf{station} ) { my $dt = $conf{datetime} // DateTime->now( time_zone => 'Europe/Berlin' ); my @mots = ( qw(ICE EC_IC IR REGIONAL SBAHN BUS SCHIFF UBAHN TRAM ANRUFPFLICHTIG) ); if ( $conf{modes_of_transit} ) { @mots = @{ $conf{modes_of_transit} // [] }; } $req = 'https://www.bahn.de/web/api/reiseloesung/abfahrten' . '?datum=' Loading @@ -59,12 +66,10 @@ sub new { . $station->{eva} . '&ortId=' . $station->{id} . '&mitVias=true&maxVias=8' . '&verkehrsmittel[]=ICE&verkehrsmittel[]=EC_IC' . '&verkehrsmittel[]=IR&verkehrsmittel[]=REGIONAL' . '&verkehrsmittel[]=SBAHN&verkehrsmittel[]=BUS' . '&verkehrsmittel[]=SCHIFF&verkehrsmittel[]=UBAHN' . '&verkehrsmittel[]=TRAM&verkehrsmittel[]=ANRUFPFLICHTIG'; . '&mitVias=true&maxVias=8'; for my $mot (@mots) { $req .= '&verkehrsmittel[]=' . $mot; } } elsif ( my $gs = $conf{geoSearch} ) { my $lat = $gs->{latitude}; Loading Loading
bin/dbris-m +15 −9 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ use List::Util qw(max); use Travel::Status::DE::DBRIS; my ( $date, $time ); my $mots; my $developer_mode; my $show_jid; my $use_cache = 1; Loading @@ -34,6 +35,7 @@ GetOptions( 'd|date=s' => \$date, 'h|help' => sub { show_help(0) }, 'j|with-jid' => \$show_jid, 'm|modes-of-transit=s' => \$mots, 't|time=s' => \$time, 'V|version' => \&show_version, 'cache!' => \$use_cache, Loading Loading @@ -140,6 +142,10 @@ if ( $date or $time ) { $opt{datetime} = $dt; } if ($mots) { $opt{modes_of_transit} = [ split( qr{, *}, $mots ) ]; } my $status = Travel::Status::DE::DBRIS->new(%opt); sub show_help { Loading
lib/Travel/Status/DE/DBRIS.pm +11 −6 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ sub new { if ( my $station = $conf{station} ) { my $dt = $conf{datetime} // DateTime->now( time_zone => 'Europe/Berlin' ); my @mots = ( qw(ICE EC_IC IR REGIONAL SBAHN BUS SCHIFF UBAHN TRAM ANRUFPFLICHTIG) ); if ( $conf{modes_of_transit} ) { @mots = @{ $conf{modes_of_transit} // [] }; } $req = 'https://www.bahn.de/web/api/reiseloesung/abfahrten' . '?datum=' Loading @@ -59,12 +66,10 @@ sub new { . $station->{eva} . '&ortId=' . $station->{id} . '&mitVias=true&maxVias=8' . '&verkehrsmittel[]=ICE&verkehrsmittel[]=EC_IC' . '&verkehrsmittel[]=IR&verkehrsmittel[]=REGIONAL' . '&verkehrsmittel[]=SBAHN&verkehrsmittel[]=BUS' . '&verkehrsmittel[]=SCHIFF&verkehrsmittel[]=UBAHN' . '&verkehrsmittel[]=TRAM&verkehrsmittel[]=ANRUFPFLICHTIG'; . '&mitVias=true&maxVias=8'; for my $mot (@mots) { $req .= '&verkehrsmittel[]=' . $mot; } } elsif ( my $gs = $conf{geoSearch} ) { my $lat = $gs->{latitude}; Loading