From 12888c2cfe2494f51df8d661e692c292e6f26b61 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 17 Sep 2015 17:51:45 +0200 Subject: StopFinder: Re-use HAFAS.pm User Agent if possible --- lib/Travel/Status/DE/HAFAS.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Travel/Status/DE/HAFAS.pm') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 26c68d6..b1ebad1 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -118,6 +118,7 @@ sub new { exclusive_mots => $conf{exclusive_mots}, excluded_mots => $conf{excluded_mots}, station => $conf{station}, + ua => $ua, post => { input => $conf{station}, date => $date, @@ -253,6 +254,7 @@ sub similar_stops { my $sf = Travel::Status::DE::HAFAS::StopFinder->new( url => $hafas_instance{$service}{stopfinder}, input => $self->{station}, + ua => $self->{ua}, ); if ( my $err = $sf->errstr ) { $self->{errstr} = $err; @@ -345,7 +347,7 @@ sub get_services { sub get_service { my ($service) = @_; - if ( defined $service and exists $hafas_instance{$service}) { + if ( defined $service and exists $hafas_instance{$service} ) { return %{ $hafas_instance{$service} }; } return; @@ -354,7 +356,7 @@ sub get_service { sub get_active_service { my ($self) = @_; - if (defined $self->{active_service}) { + if ( defined $self->{active_service} ) { return %{ $hafas_instance{ $self->{active_service} } }; } return; -- cgit v1.2.3