From 5807b0b705e1e84e0845edc4e03ca7297ce42e72 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 2 Nov 2023 20:27:22 +0100 Subject: hafas-m: Fall back to locationSearch if ajax-getstop.exe is unavailable --- bin/hafas-m | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bin/hafas-m') 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; } -- cgit v1.2.3