summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm5
-rw-r--r--lib/Travel/Status/DE/HAFAS/Services.pm.PL13
2 files changed, 13 insertions, 5 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm
index 379bd82..638b4af 100644
--- a/lib/Travel/Status/DE/HAFAS.pm
+++ b/lib/Travel/Status/DE/HAFAS.pm
@@ -42,6 +42,9 @@ sub new {
if ( not $ua ) {
my %lwp_options = %{ $conf{lwp_options} // { timeout => 10 } };
+ if ( $service and $hafas_instance->{$service}{ua_string} ) {
+ $lwp_options{agent} = $hafas_instance->{$service}{ua_string};
+ }
$ua = LWP::UserAgent->new(%lwp_options);
$ua->env_proxy;
}
@@ -137,7 +140,7 @@ sub new {
y => int( $conf{geoSearch}{lat} * 1e6 ),
},
maxDist => -1,
- minDist => 0,
+ minDist => 0,
},
locFltrL => [
{
diff --git a/lib/Travel/Status/DE/HAFAS/Services.pm.PL b/lib/Travel/Status/DE/HAFAS/Services.pm.PL
index 4f491bb..f0e1d18 100644
--- a/lib/Travel/Status/DE/HAFAS/Services.pm.PL
+++ b/lib/Travel/Status/DE/HAFAS/Services.pm.PL
@@ -75,6 +75,9 @@ sub load_instance {
if ( $opt{lang} ) {
$ret{request}{lang} = $opt{lang};
}
+ if ( $opt{ua_string} ) {
+ $ret{ua_string} = $opt{ua_string};
+ }
if ( $opt{ver} ) {
$ret{request}{ver} = $opt{ver};
}
@@ -179,10 +182,12 @@ my %hafas_instance = (
),
stopfinder => 'https://fahrplan.oebb.at/bin/ajax-getstop.exe',
},
- Resrobot => { load_instance( 'se/resrobot', lang => 'sve' ), },
- RMV => { load_instance( 'de/rmv', lang => 'deu' ), },
- RSAG => { load_instance( 'de/rsag', lang => 'deu' ), },
- SaarVV => { load_instance( 'de/saarvv', lang => 'deu' ), },
+ PKP =>
+ { load_instance( 'pl/pkp', lang => 'pol' ), ua_string => 'Dalvik/2.1.0' },
+ Resrobot => { load_instance( 'se/resrobot', lang => 'sve' ), },
+ RMV => { load_instance( 'de/rmv', lang => 'deu' ), },
+ RSAG => { load_instance( 'de/rsag', lang => 'deu' ), },
+ SaarVV => { load_instance( 'de/saarvv', lang => 'deu' ), },
STV => { load_instance( 'at/stv', lang => 'deu', ver => '1.32' ), },
TPG => { load_instance( 'ch/tpg', lang => 'deu', ver => '1.40' ), },
VBB => {