Navigation Menu

Skip to content

Commit

Permalink
Added more candidates. Moved .csv to .tsv
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Aug 17, 2014
1 parent 7ab005b commit 6443ab0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bin/dump_cand
Expand Up @@ -7,7 +7,7 @@ use 5.010;
use lib 'lib';
use TwittElection::Schema;

my $file = shift || 'db/candidate.csv';
my $file = shift || 'db/candidate.tsv';

my $sch = TwittElection::Schema->connect(
"dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS},
Expand Down
4 changes: 2 additions & 2 deletions bin/load_cand
Expand Up @@ -7,7 +7,7 @@ use 5.010;
use lib 'lib';
use TwittElection::Schema;

my $file = shift || 'db/candidate.csv';
my $file = shift || 'db/candidate.tsv';

my $sch = TwittElection::Schema->connect(
"dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS},
Expand All @@ -25,7 +25,7 @@ $sch->resultset('Candidate')->delete;
while (<$fh>) {
chomp;

my ($name, $twitter, $party, $constituency) = split /\|/;
my ($name, $twitter, $party, $constituency) = split /\t/;

my $con = $con_rs->find({
name => $constituency,
Expand Down
14 changes: 0 additions & 14 deletions db/candidate.csv

This file was deleted.

26 changes: 26 additions & 0 deletions db/candidate.tsv
@@ -0,0 +1,26 @@
Jane Ellison janeellisonmp Conservative Battersea
Dan Watkins DanWatkins Conservative Tooting
Nadine Dorries NadineDorriesMP Conservative Mid Bedfordshire
Will Martindale WillJMartindale Labour Battersea
Sadiq Khan SadiqKhan Labour Tooting
Charlynne Pullen CharlynnePullen Labour Mid Bedfordshire
Douglas Carswell DouglasCarswell Conservative Clacton
Stephen Kinnock SKinnock Labour Aberavon
Guto Bebb GutoBebb Conservative Aberconwy
Frank Doran Labour Aberdeen North
Anne Begg annebegg Labour Aberdeen South
Pamela Nash pamela_nash Labour Airdrie and Shotts
Gerald Howarth geraldhowarth Conservative Aldershot
Richard Shepherd Conservative Aldridge-Brownhills
Graham Brady grahambradymp Conservative Altrincham and Sale West
Mark Tami MarkTamiMP Labour Alyn and Deeside
Nigel Mills NigelMillsMP Conservative Amber Valley
Mike Weir mikeweirsnp SNP Angus
Hywel Williams HywelWilliamsMP Plaid Cymru Arfon
Alan Reid Liberal Democrat Argyll and Bute
Nick Herbert nickherbertmp Conservative Arundel and South Downs
Gloria De Piero GloriaDePieroMP Labour Ashfield
Damian Green Conservative Ashford
David Heyes davidheyesmp Labour Ashton-under-Lyne
David Lidington DLidington Conservative Aylesbury
Sandra Osborne Labour Ayr, Carrick and Cumnock
2 changes: 1 addition & 1 deletion lib/TwittElection/Schema/Result/Candidate.pm
Expand Up @@ -148,7 +148,7 @@ __PACKAGE__->belongs_to(

sub dump {
my $self = shift;
my $delim = $_[0] || '|';
my $delim = $_[0] || "\t";

return join $delim, $self->name, $self->twitter,
$self->party->name, $self->constituency->name;
Expand Down

0 comments on commit 6443ab0

Please sign in to comment.