mysociety / yournextrepresentative

A website for crowd-sourcing structured election candidate data
https://candidates.democracyclub.org.uk/
GNU Affero General Public License v3.0
56 stars 21 forks source link

Add a "this person won" button #61

Closed dracos closed 9 years ago

dracos commented 9 years ago

It would be good, in a lovely ideal world, for there to be a button that could update the person data store that TheyWorkForYou is using and prompt an update of data on TheyWorkForYou. On election night, some authenticated person could click this button for each constituency as results came in. They would not have to manually update an XML file and run a Perl script 650 times. Who would do that? Even if they get some of the results before the PA.

Currently, that would be something that edited all-members-2010.xml (or a new 2015 file I guess) and prompted a run of a changed/updated/renamed xml2db-2010.pl. It could theoretically, if time were available, be an update of some Popolo person data (potentially in PopIt) and a run of an update script (that would have been changed already to deal with those changes).

Historical note that can be ignored, but I don't think I've written this anywhere before:

For the 2005 general election, I was at a conference in Canada (that's a sad aside as to how I saw nothing of Vancouver but the airport and the hotel, and of course the lovely view across the water to the mountains from the hotel), and so the time difference was quite handy for updating people at the election. I can't be bothered to dig into the CVS or SVN archaeology as to how it was updated, but it was.

Between the 2005 and 2010 general election, TheyWorkForYou gained historical MPs back to the start of Hansard (18mumble mumble) based on some work and open data from Parliament. The all-members.xml file grew to be rather larger than it had hitherto been.

This larger file took much longer to parse/import, which was never really a concern for something that was only run for a MP change or similar. At the time of the 2010 general election, I wanted to have TheyWorkForYou update with election results as quickly as possible (see aforementioned beating the PA feed), so made a 'temporary' separate XML file that could be edited and loaded in separately more quickly. This file has of course persisted since then.

lizconlan commented 9 years ago

...and if that happens, I think that's my election night plan sorted

On 27 November 2014 at 15:07, Matthew Somerville notifications@github.com wrote:

It would be good, in a lovely ideal world, for there to be a button that could update the person data store that TheyWorkForYou is using and prompt an update of data on TheyWorkForYou. On election night, some authenticated person could click this button for each constituency as results came in. They would not have to manually update an XML file and run a Perl script 650 times. Who would do that? Even if they get some of the results before the PA.

Currently, that would be something that edited all-members-2010.xml (or a new 2015 file I guess) and prompted a run of a changed/updated/renamed xml2db-2010.pl. It could theoretically, if time were available, be an update of some Popolo person data (potentially in PopIt) and a run of an update script (that would have been changed already to deal with those changes).

Historical note that can be ignored, but I don't think I've written this anywhere before:

For the 2005 general election, I was at a conference in Canada (that's a sad aside as to how I saw nothing of Vancouver but the airport and the hotel, and of course the lovely view across the water to the mountains from the hotel), and so the time difference was quite handy for updating people at the election. I can't be bothered to dig into the CVS or SVN archaeology as to how it was updated, but it was.

Between the 2005 and 2010 general election, TheyWorkForYou gained historical MPs back to the start of Hansard (18mumble mumble) based on some work and open data from Parliament. The all-members.xml file grew to be rather larger than it had hitherto been.

This larger file took much longer to parse/import, which was never really a concern for something that was only run for a MP change or similar. At the time of the 2010 general election, I wanted to have TheyWorkForYou update with election results as quickly as possible, so made a 'temporary' separate XML file https://github.com/mysociety/parlparse/commit/332f736909774af5429e47378ba5e0192e29b6c5 that could be edited and loaded in separately more quickly. This file has of course persisted since then.

— Reply to this email directly or view it on GitHub https://github.com/mysociety/yournextmp-popit/issues/61.

andylolz commented 9 years ago

I really like this idea. (Related: I’d really like to see “Your Next MP is…” on each YourNextMP constituency page after election night.)

some authenticated person could click this button for each constituency as results came in

Yes – I guess it might be necessary for them to be trusted (i.e. an admin.)

I think that's my election night plan sorted

Amazing! We have a winner! :rocket:

mhl commented 9 years ago

Things to do:

MyfanwyNixon commented 9 years ago

I have written a draft blog post about this process, and I'd be glad if it could be fact-checked by a mySoc colleague, please. It's actually rather light on technical detail and (personally) I think that's fine for the majority of our readers; devs, you might want to write a more tecchie post later on?

https://blogs.mysociety.org/mysociety/?p=23991&preview=true (only accessible to mySoc folk, sorry)

wrightmartin commented 9 years ago

I've quickly thrown together changes to YNMP's public facing front-end post election.

This is mainly to give us some discussion points, so be sure to let loose with your feedback :)

Constituency page

I've kept the rest of the page as is, but I wonder should we also indicate on their box in the list somehow?

ynmp-elected-constituency

Candidate page

Looking at this now maybe it could be a little less subtle? Thoughts?

ynmp-elected-candidate

Let me know your thoughts and any further changes

wrightmartin commented 9 years ago

maybe I'd go to town on the candidate page – a bigger message saying "This candidate won in the 2015 election. Show the other candidates. – @zarino

MyfanwyNixon commented 9 years ago

I understand the branding impetus behind "Your next MP is", but I think it's clearer/more impactful if it says "Your new MP is".

Maybe "The election is over! The votes have been counted! Your new MP is..."

On the box, how about a "winner" or "elected" ribbon or a rosette? This could also go on the candidate page.

And then maybe something on the non-winners' pages to show that they were unsuccessful?

Across the other areas of the site, eg the CV upload, the past tense will now feel more appropriate than the present perfect (ie "no-one sent a CV" instead of "no-one has sent".

wrightmartin commented 9 years ago

I understand the branding impetus behind "Your next MP is", but I think it's clearer/more impactful if it says "Your new MP is".

Of all the people myf I thought you'd love this bit :) Fancy penning something?

And then maybe something on the non-winners' pages to show that they were unsuccessful?

Good point!

On the box, how about a "winner" or "elected" ribbon or a rosette? This could also go on the candidate page.

What do others think about this? I wasn't sure if it fits the general aesthetic of YNMP?

Across the other areas of the site, eg the CV upload, the past tense will now feel more appropriate than the present perfect (ie "no-one sent a CV" instead of "no-one has sent".

Potentially a big job - but yeah, I assume the site will be kept online in its current state for archival purposes

zarino commented 9 years ago

winner

If the winning MP's a new one, their TWFY profile page will be mostly empty, with just a box to subscribe to email updates. Could we save people a click, by doing something like…?

# pseudo-code
if candidate.won_in_2015 and candidate.won_in_2010:
  print '<a href="…">Show this candidate’s voting history on TheyWorkForYou.com</a>'
else:
  print '<a href="…">Get notified when this candidate next acts in Parliament</a>'

Or even putting the form inline on YNMP and posting to the TWFY email subscription endpoint directly?

wrightmartin commented 9 years ago

Here's updated designs

Losing candidate

ynmp-unelected-candidate

Elected candidate

ynmp-elected-candidate

Constituency

ynmp-elected-constituency

MyfanwyNixon commented 9 years ago

:+1: Is the 'w' for 'winner'? Could potentially be confusing, I guess.

zarino commented 9 years ago

What's the "W" in the rosette stand for? "Winner"? How about a "#1" instead?

And "Subscribe to Laura Davies updates on TheyWorkForYou.com →" is a bit long for a call to action!

MyfanwyNixon commented 9 years ago

Assuming the LH call to action actually meant to say "View Laura Davies on TWFY.com" they'll both be quite long. A line break before 'on' might help.

Although, it's hard to summarise the benefit in one short line like this: I'm not at all sure anyone will subscribe on such little information. Maybe 'Get an email every time Laura Davies speaks'?

Also - any value in 'write to your new MP now' and a link to WTT? I'm not sure when WTT will be up-to-date enough.

wrightmartin commented 9 years ago

Good feedback, here's the candidate page again with some changes

ynmp-elected-candidate

zarino commented 9 years ago

Sorry to pester, but I don't get the benefit of "Laura Davies on TheyWorkForYou.com" – why would I click that?

If we know that her page on TWFY shows her voting history, then surely a more attractive link would read "Laura Davies' voting history in Parliament".

If she's a new MP with no voting history, though, as I said above, I probably wouldn't even link to TWFY. It won't benefit people at all. Better, in that case, to prioritise the "Get notified when Laura Davies speaks in Parliament" call to action.

wrightmartin commented 9 years ago

@zarino good points, my thoughts:

JoeMitchell commented 9 years ago

Looks cool! I agree that the CTA should be to 'Get an email when Laura speaks in Parliament' - cos traffic is likely to disappear before Laura ever makes a vote :)

mhl commented 9 years ago

One thing we won't easily have (at the moment) is the TheyWorkForYou ID for someone who isn't already in TheyWorkForYou, i.e. any newly elected candidate who hasn't previously been an MSP or an MLA, for example. We can probably work out a nice way of doing this in time, but I wouldn't promise that.

dracos commented 9 years ago

The alert lookup does also work for someone's name as a string (you might not realise that as currently it won't work for MP names, but e.g. http://www.theyworkforyou.com/alert/?alertsearch=clare+adamson), and that could almost certainly be streamlined (currently it will ask if you want things by the person or mentions of the person's name, but given they don't refer to each other by name anyway, I doubt you would want that). So if the name is unique, that'd be good enough, it'd just ask for email (and could use design of https://github.com/mysociety/theyworkforyou/pull/818 without postcode in some way).