diff options
Diffstat (limited to 'bin/open311-populate-service-list')
-rwxr-xr-x | bin/open311-populate-service-list | 11 |
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"; } } |