From eeb777112f61ec4f133c8f890ff76aeaabf5729e Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 23 Nov 2014 23:14:43 +0100 Subject: IRIS backend: try get_station first --- index.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'index.pl') diff --git a/index.pl b/index.pl index c135f68..9b4b3ea 100644 --- a/index.pl +++ b/index.pl @@ -33,6 +33,16 @@ sub get_results_for { if ( not $results ) { if ( $backend eq 'iris' ) { + + # requests with DS100 codes should be preferred (they avoid + # encoding problems on the IRIS server). However, only use them + # if we have an exact match. Ask the backend otherwise. + my @station_matches + = Travel::Status::DE::IRIS::Stations::get_station($station); + if ( @station_matches == 1 ) { + $station = $station_matches[0][0]; + } + my $status = Travel::Status::DE::IRIS->new( station => $station, serializable => 1 -- cgit v1.2.3