From bda007995f057939b123e6705c912d37f49f1f9c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 6 Nov 2022 10:23:31 +0100 Subject: station board: allow users to override maxjny and duration --- lib/Travel/Status/DE/HAFAS.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 3e9456d..3e2db84 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -270,6 +270,9 @@ sub new { } } + my $maxjny = $conf{results} // 30; + my $duration = $conf{lookahead} // -1; + $req = { svcReqL => [ { @@ -278,10 +281,10 @@ sub new { type => ( $conf{arrivals} ? 'ARR' : 'DEP' ), stbLoc => { lid => $lid }, dirLoc => undef, - maxJny => 30, + maxJny => $maxjny, date => $date, time => $time, - dur => -1, + dur => $duration, jnyFltrL => [ { type => "PROD", @@ -808,11 +811,23 @@ I, ... will be returned. The supported modes depend on B, use B or B to get the supported values. Only relevant in station board mode. +=item B => I + +Request arrivals/departures that occur up to I minutes after the specified datetime. +Default: -1 (do not limit results by time). +Only relevant in station board mode. + =item B => I<\%hashref> Passed on to C<< LWP::UserAgent->new >>. Defaults to C<< { timeout => 10 } >>, pass an empty hashref to call the LWP::UserAgent constructor without arguments. +=item B => I + +Request up to I results. +Default: 30. +Only relevant in station board mode. + =item B => I Request results from I, defaults to "DB". -- cgit v1.2.3