aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetServiceRequestUpdates.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-10-17 12:52:27 +0100
committerStruan Donald <struan@exo.org.uk>2012-10-17 12:52:27 +0100
commit799ddcad7369bef12ef4a2795cd74787b34bc7ee (patch)
treec92413cf110d6c5b14ec803f0ca12e0905fda05a /perllib/Open311/GetServiceRequestUpdates.pm
parent0b29251ad6bd71091bdb314fc7504a1eaaea3d22 (diff)
add script to fetch last 24 hours of updates as a backup and default to last 2 hours in standard script
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index 36d42bb3e..1f0852c96 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -54,6 +54,14 @@ sub update_comments {
push @args, $self->start_date;
push @args, $self->end_date;
+ # default to asking for last 2 hours worth if not Bromley
+ } elsif ( $council_details->{areaid} != 2482 ) {
+ my $end_dt = DateTime->now();
+ my $start_dt = $end_dt->clone;
+ $start_dt->add( hours => -2 );
+
+ push @args, DateTime::Format::W3CDTF->format_datetime( $start_dt );
+ push @args, DateTime::Format::W3CDTF->format_datetime( $end_dt );
}
my $requests = $open311->get_service_request_updates( @args );