diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/canonicalise-csv | 28 | ||||
-rwxr-xr-x | bin/load-contacts | 4 |
2 files changed, 16 insertions, 16 deletions
diff --git a/bin/canonicalise-csv b/bin/canonicalise-csv index 72502e2d8..6163b3741 100755 --- a/bin/canonicalise-csv +++ b/bin/canonicalise-csv @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: canonicalise-csv,v 1.1 2006-10-13 15:37:48 matthew Exp $ +# $Id: canonicalise-csv,v 1.2 2007-01-26 22:48:30 matthew Exp $ use strict; require 5.8.0; @@ -82,20 +82,20 @@ foreach my $type (@$types) { my $areas_info = mySociety::MaPit::get_voting_areas_info($areas); foreach my $id (keys %$areas_info) { my $area_info = $areas_info->{$id}; - my $name = $area_info->{name}; - if ($name eq 'Durham City Council') { - $out{$id} = $councils{'Durham City'}; - next; - } elsif ($name eq 'Durham County Council') { - $out{$id} = $councils{'Durham County'}; - next; - } - $name =~ s/( (Borough|City|District|County))* Council//; + my $name = $area_info->{name}; + if ($name eq 'Durham City Council') { + $out{$id} = $councils{'Durham City'}; + next; + } elsif ($name eq 'Durham County Council') { + $out{$id} = $councils{'Durham County'}; + next; + } + $name =~ s/( (Borough|City|District|County))* Council//; if ($councils{$name} && $councils{$name} =~ /@/) { - $out{$id} = $councils{$name}; - } elsif ($councils{$name} || exists($councils{$name})) { - push @missing, $id; - } + $out{$id} = $councils{$name}; + } elsif ($councils{$name} || exists($councils{$name})) { + push @missing, $id; + } } } diff --git a/bin/load-contacts b/bin/load-contacts index bac8497d3..d3f0681e2 100755 --- a/bin/load-contacts +++ b/bin/load-contacts @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: load-contacts,v 1.1 2006-10-13 15:37:48 matthew Exp $ +# $Id: load-contacts,v 1.2 2007-01-26 22:48:30 matthew Exp $ use strict; require 5.8.0; @@ -42,7 +42,7 @@ while (<FP>) { my ($id, $email) = split /,/; dbh()->do("INSERT INTO contacts (area_id, email, editor, whenedited, note) VALUES (?, ?, 'import', ms_current_timestamp(), 'Initial import')", - {}, $id, $email); + {}, $id, $email); } dbh()->commit(); close(FP); |