summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-11-06 10:23:31 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-11-06 10:23:31 +0100
commitbda007995f057939b123e6705c912d37f49f1f9c (patch)
treee13fb7f73764d8c8f3f3825da45f682e0dade20c /lib/Travel
parent882a68c196c14a98a5e18bc1b7a277088e491344 (diff)
station board: allow users to override maxjny and duration
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm19
1 files changed, 17 insertions, 2 deletions
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<mot2>, ... will be returned. The supported modes depend on B<service>, use
B<get_services> or B<get_service> to get the supported values.
Only relevant in station board mode.
+=item B<lookahead> => I<int>
+
+Request arrivals/departures that occur up to I<int> minutes after the specified datetime.
+Default: -1 (do not limit results by time).
+Only relevant in station board mode.
+
=item B<lwp_options> => 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<results> => I<count>
+
+Request up to I<count> results.
+Default: 30.
+Only relevant in station board mode.
+
=item B<service> => I<service>
Request results from I<service>, defaults to "DB".