diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-02 20:27:22 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-02 20:27:22 +0100 |
commit | 5807b0b705e1e84e0845edc4e03ca7297ce42e72 (patch) | |
tree | 7f1043bb47548cc5927712d0f4ff789c05f10e44 /bin/hafas-m | |
parent | 69fab1ec04ecacd83e03b4e2b7cf0dd24846e899 (diff) |
hafas-m: Fall back to locationSearch if ajax-getstop.exe is unavailable
Diffstat (limited to 'bin/hafas-m')
-rwxr-xr-x | bin/hafas-m | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/hafas-m b/bin/hafas-m index f3fbc39..8125d96 100755 --- a/bin/hafas-m +++ b/bin/hafas-m @@ -176,6 +176,19 @@ sub show_similar_stops { for my $c (@candidates) { printf( "%s (%s)\n", $c->{name}, $c->{id} ); } + return; + } + my $hafas = Travel::Status::DE::HAFAS->new( + locationSearch => $opt{station}, + developer_mode => $developer_mode, + service => $service, + language => $language, + ); + if ( $hafas->results ) { + say 'You might want to try one of the following stops:'; + for my $r ( $hafas->results ) { + printf( "%s (%s)\n", $r->name, $r->eva ); + } } return; } |