aboutsummaryrefslogtreecommitdiffstats
path: root/bin/open311-populate-service-list
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-01 18:54:07 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-01 18:54:07 +0100
commit6d38f3aeaa6f4eb0f51a773658cb4923d45f6968 (patch)
tree0b331bad65d9faef2dfa22af90b7cb1d0a9b05ed /bin/open311-populate-service-list
parent720fc7ff7f9a375389ae4ba67bb56ce55587363a (diff)
slight neatening of data structure and some html tidy up
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";