aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-01 14:25:41 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-01 14:25:41 +0100
commit8d841abcf6a6539344094927ffb7b82d38b70473 (patch)
tree982fd638f393406f697176fcc8be1f1811b518a8 /bin/open311-populate-service-list
parentb2ede4c4eb67ef7bd419837b5e4d753a8899ef75 (diff)
populate open311 meta data in contacts
Diffstat (limited to 'bin/open311-populate-service-list')
-rwxr-xr-xbin/open311-populate-service-list11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index ddab063f4..7e4411d6b 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -19,10 +19,8 @@ while ( my $council = $council_list->next ) {
api_key => $council->api_key
);
- my $service_list = $open311->get_service_list;
+ my $list = $open311->get_service_list;
- my $xml = XML::Simple->new();
- my $list = $xml->XMLin( $service_list );
my @found_contacts;
# print Dumper $list;
@@ -73,6 +71,13 @@ while ( my $council = $council_list->next ) {
note => 'created automatically by script',
}
);
+
+ if ( lc( $service->{metadata} ) eq 'true' ) {
+ print "Fetching meta data for $service->{service_code}\n";
+ my $meta_data = $open311->get_service_meta_info( $service->{service_code} );
+ $contact->extra( $meta_data );
+ $contact->update;
+ }
print "created contact for service code " . $service->{service_code} . " for council @{[$council->area_id]}\n";
}
}