aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-01-21 22:55:40 +0000
committerDave Whiteland <dave@mysociety.org>2013-01-21 22:55:40 +0000
commit95d6bb8fcced530ad68438ed9a44a47cb38f0014 (patch)
tree3be72038221b009f5944a975b2891ab5b802f058 /perllib/Open311
parent6a8f1a0f959a975bbd263962f70842a48ccf1a5d (diff)
tidy up hardcoded council (area) ids
Diffstat (limited to 'perllib/Open311')
-rw-r--r--perllib/Open311/GetServiceRequestUpdates.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm
index c08d81a8c..a97c4c379 100644
--- a/perllib/Open311/GetServiceRequestUpdates.pm
+++ b/perllib/Open311/GetServiceRequestUpdates.pm
@@ -12,7 +12,8 @@ has end_date => ( is => 'ro', default => undef );
has suppress_alerts => ( is => 'rw', default => 0 );
has verbose => ( is => 'ro', default => 0 );
-Readonly::Scalar my $COUNCIL_ID_OXFORDSHIRE => 2237;
+Readonly::Scalar my $AREA_ID_BROMLEY => 2482;
+Readonly::Scalar my $AREA_ID_OXFORDSHIRE => 2237;
sub fetch {
my $self = shift;
@@ -35,12 +36,12 @@ sub fetch {
);
# custom endpoint URLs because these councils have non-standard paths
- if ( $council->area_id =~ /2482/ ) {
+ if ( $council->area_id =~ /\b$AREA_ID_BROMLEY\b/o ) {
my $endpoints = $o->endpoints;
$endpoints->{update} = 'update.xml';
$endpoints->{service_request_updates} = 'update.xml';
$o->endpoints( $endpoints );
- } elsif ($council->area_id =~/$COUNCIL_ID_OXFORDSHIRE/o) {
+ } elsif ($council->area_id =~/\b$AREA_ID_OXFORDSHIRE\b/o) {
my $endpoints = $o->endpoints;
$endpoints->{service_request_updates} = 'open311_service_request_update.cgi';
$o->endpoints( $endpoints );
@@ -63,7 +64,7 @@ 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 ) {
+ } elsif ( $council_details->{areaid} != $AREA_ID_BROMLEY ) {
my $end_dt = DateTime->now();
my $start_dt = $end_dt->clone;
$start_dt->add( hours => -2 );