aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
diff options
context:
space:
mode:
Diffstat (limited to 'bin/open311-populate-service-list')
-rwxr-xr-xbin/open311-populate-service-list9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/open311-populate-service-list b/bin/open311-populate-service-list
index 7e4411d6b..f9f183f26 100755
--- a/bin/open311-populate-service-list
+++ b/bin/open311-populate-service-list
@@ -75,7 +75,14 @@ while ( my $council = $council_list->next ) {
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 );
+
+ # turn the data into something a bit more friendly to use
+ my %meta = ();
+ foreach my $attribute ( @{ $meta_data->{attribute} } ) {
+ $meta{ $attribute->{code} } = $attribute;
+ }
+
+ $contact->extra( \%meta );
$contact->update;
}
print "created contact for service code " . $service->{service_code} . " for council @{[$council->area_id]}\n";