aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@fury.ukcod.org.uk>2011-09-27 20:10:32 +0100
committerStruan Donald <struan@fury.ukcod.org.uk>2011-09-27 20:10:32 +0100
commitbb8cb663d0827171eda019fca19fc7d9f2cce36f (patch)
tree507a6c1d7ec1fbf155f14857a2b68fd9debea1e0
parent831c36c7c2eff338e68db768aa03a246386a346a (diff)
use custom end points for west berks
strip trailing white space from category names
-rwxr-xr-xbin/open311-populate-service-list19
1 files changed, 17 insertions, 2 deletions
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index 2a6733ef1..cb22d6dad 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -19,6 +19,16 @@ while ( my $council = $council_list->next ) {
api_key => $council->api_key
);
+ # west berks end point not standard
+ if ( $council->area_id == 2619 ) {
+ $open311->endpoints(
+ {
+ services => 'Services',
+ requests => 'Requests'
+ }
+ );
+ }
+
my $list = $open311->get_service_list;
my @found_contacts;
@@ -39,6 +49,11 @@ while ( my $council = $council_list->next ) {
my $contact = $contacts->first;
+ # remove trailing whitespace as it upsets db queries
+ # to look up contact details when creating problem
+ my $service_name = $service->{service_name};
+ $service_name =~ s/\s+$//;
+
# FIXME - handle change of service name or service code
if ( $contact ) {
@@ -48,7 +63,7 @@ while ( my $council = $council_list->next ) {
if ( $contact->deleted ) {
$contact->update(
{
- category => $service->{service_name},
+ category => $service_name,
email => $service->{service_code},
confirmed => 1,
deleted => 0,
@@ -63,7 +78,7 @@ while ( my $council = $council_list->next ) {
{
email => $service->{service_code},
area_id => $council->area_id,
- category => $service->{service_name},
+ category => $service_name,
confirmed => 1,
deleted => 0,
editor => $0,