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.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index 6e6e3b905..0b4e037fd 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_request_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,12 +55,20 @@ 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 );
unless ( $open311->success ) {
- warn "Failed to fetch ServiceRequest Updates: " . $open311->error
+ warn "Failed to fetch ServiceRequest Updates for " . $council_details->{areaid} . ":\n" . $open311->error
if $self->verbose;
return 0;
}