diff options
author | Struan Donald <struan@exo.org.uk> | 2012-11-19 12:20:55 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-11-19 12:20:55 +0000 |
commit | 468f89a56ad2cc69ec4ad4904a18dcf891a505cd (patch) | |
tree | e0f69cec5ddb98e9e2920c51eb92c00075757559 /perllib/Open311/GetServiceRequestUpdates.pm | |
parent | 136fd944c596e6cebd5127955fb507ae155725c1 (diff) | |
parent | b81ba9819a4f33c21354617538a545a6520eb4d1 (diff) |
Merge branch 'stevenage'
Conflicts:
.gitignore
bin/make_css
conf/crontab.ugly
perllib/FixMyStreet/Cobrand/Default.pm
perllib/Open311.pm
templates/web/fixmystreet/around/postcode_form.html
Diffstat (limited to 'perllib/Open311/GetServiceRequestUpdates.pm')
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 15 |
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 ); |