From 717cc18a403d6705c64a9a6fd43578c1efbb159f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 6 Aug 2020 16:04:12 +0200 Subject: Move get_departures to a separate IRIS helper --- lib/Travelynx/Command/work.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/Travelynx/Command/work.pm') diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index 727a694..9c870d8 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -35,7 +35,11 @@ sub run { eval { if ( $now->epoch - $entry->{real_dep_ts} < 900 ) { - my $status = $self->app->get_departures( $dep, 30, 30 ); + my $status = $self->app->iris->get_departures( + station => $dep, + lookbehind => 30, + lookahead => 30 + ); if ( $status->{errstr} ) { die("get_departures($dep): $status->{errstr}\n"); } @@ -123,7 +127,11 @@ sub run { or $now->epoch - $entry->{real_arr_ts} < 600 ) ) { - my $status = $self->app->get_departures( $arr, 20, 220 ); + my $status = $self->app->iris->get_departures( + station => $arr, + lookbehind => 20, + lookahead => 220 + ); if ( $status->{errstr} ) { die("get_departures($arr): $status->{errstr}\n"); } -- cgit v1.2.3