summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Helper/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-01 18:44:00 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-01 18:44:00 +0100
commit6364751eb13ed18111e69a06185657d64bdea5ac (patch)
tree74fc90ed2515996cb7f5db062a078836b72542c9 /lib/Travelynx/Helper/HAFAS.pm
parent0b1de4136647190003b2362fdd6a89fec53eb9e4 (diff)
HAFAS: Use locationSearch rather than similar_stops_p
locationSearch uses mgate.exe, just like the regular departure board. similar_stops_p relies on ajax-getstop.exe which may become unavailable sooner rather than later.
Diffstat (limited to 'lib/Travelynx/Helper/HAFAS.pm')
-rw-r--r--lib/Travelynx/Helper/HAFAS.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Travelynx/Helper/HAFAS.pm b/lib/Travelynx/Helper/HAFAS.pm
index 1c36925..6a759b0 100644
--- a/lib/Travelynx/Helper/HAFAS.pm
+++ b/lib/Travelynx/Helper/HAFAS.pm
@@ -98,6 +98,17 @@ sub get_departures_p {
);
}
+sub search_location_p {
+ my ( $self, %opt ) = @_;
+
+ return Travel::Status::DE::HAFAS->new_p(
+ locationSearch => $opt{query},
+ cache => $self->{realtime_cache},
+ promise => 'Mojo::Promise',
+ user_agent => $self->{user_agent}->request_timeout(5),
+ );
+}
+
sub get_journey_p {
my ( $self, %opt ) = @_;