summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-02-09 10:58:16 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-02-09 10:58:16 +0100
commit520e11a25e0c970cc0382af4bfb3565a9ced96fa (patch)
treef582530b9454b74da847a366ca78141b783408ae /lib/Travel/Status/DE/HAFAS
parentdc87974aabe306e7cddad0657b378a6fe13723c8 (diff)
Add PKP support
Requires "probably Polish" IP address that is allowed at the PKP endpoint When using new_p or providing a ua object, the user agent string must be set to 'Dalvik/2.1.0'.
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Services.pm.PL13
1 files changed, 9 insertions, 4 deletions
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 => {