From 520e11a25e0c970cc0382af4bfb3565a9ced96fa Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sun, 9 Feb 2025 10:58:16 +0100 Subject: 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'. --- lib/Travel/Status/DE/HAFAS/Services.pm.PL | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/Travel/Status/DE/HAFAS/Services.pm.PL') 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 => { -- cgit v1.2.3