aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetServiceRequestUpdates.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index 6e6e3b905..656fa9d68 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -32,6 +32,13 @@ sub fetch {
jurisdiction => $council->jurisdiction,
);
+ if ( $council->area_id =~ /2482/ ) {
+ my $endpoints = $o->endpoints;
+ $endpoints->{update} = 'update.xml';
+ $endpoints->{service_requests_updates} = 'update.xml';
+ $o->endpoints( $endpoints );
+ }
+
$self->suppress_alerts( $council->suppress_alerts );
$self->system_user( $council->comment_user );
$self->update_comments( $o, { areaid => $council->area_id }, );
@@ -48,6 +55,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 );