From dfe612b078064a011afb51847d77fa68f234e479 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 11 Oct 2015 14:38:44 +0200 Subject: shorten_line: handle HAFAS Tram prefixes --- index.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.pl b/index.pl index 81217b0..c574328 100644 --- a/index.pl +++ b/index.pl @@ -92,7 +92,7 @@ sub get_results { my $status; if ( $backend eq 'hafas' ) { $status = Travel::Status::DE::HAFAS->new( - station => ( $city ? "${city} ${stop}" : $stop ), + station => ( $city ? "${city} ${stop}" : $stop ), excluded_mots => [qw[ice ic_ec d regio]], service => $sub_backend, ); @@ -184,10 +184,10 @@ sub handle_request { sub shorten_line { my ($line) = @_; - $line =~ s{ \s* S-Bahn }{}ox; + $line =~ s{ \s* S-Bahn }{}ix; - $line =~ s{ ^ ( U | S | SB ) \K \s+ }{}ox; - $line =~ s{ ^ ( STR | Bus | RNV ) }{}ox; + $line =~ s{ ^ ( U | S | SB ) \K \s+ }{}ix; + $line =~ s{ ^ ( STR | Bus | RNV | Tram ) }{}ix; $line =~ s{ ^ \s+ }{}ox; -- cgit v1.2.3