Code Monkey home page Code Monkey logo

nyt-2020-election-scraper's People

Contributors

alex avatar andrewtelkamp avatar aschmitz avatar bellachp avatar bojanrajkovic avatar dashed avatar derpston avatar dpiganell avatar dracos avatar fractionalhare avatar frewsxcv avatar graingert avatar jonathangrant avatar julesdt avatar kglowinski avatar latacora-tomekr avatar loisaidasam avatar lunixbochs avatar macgibbons avatar mathiasbynens avatar maxwell avatar nelhage avatar nikilxyz avatar phildini avatar saleemrashid avatar samczsun avatar sebsebmc avatar thomasdesr avatar titanous avatar tqbf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nyt-2020-election-scraper's Issues

Prune Change=0 in Shrink Tables mode

For the Shrink Tables mode, I would hide blocks with no votes. Alternative, the blocks with zero votes don't seem particularly useful, so I would consider hiding them entirely.

Count of delta in notification

I think that you something like this

function sum_changes(data) {
  var sumchange = 0;
  $(data).find('.table').each(function() {
    $(this).find('tbody tr').each(function() {
      sumchange += parseInt($(this).find('td:nth(4)').text().replace(/,/g, ''));
    })
  });
  return sumchange;
}

Then something like

var delta = sum_changes(newContent) - sum_changes(document);
new Notification("New ballots(" + delta + ") were counted!");

Notifications aren't entirely accurate

As I said in this comment, the current logic for notifications is imperfect in that they trigger when the site deploys with a change to the HTML rather than a change to the underlying data.

I'm not really sure how we could distinguish the two, honestly. We could hack around it by creating a separate file to track just the data that'd be updated every time the data updates (and then check for updates to that file rather than the generated HTML), or change the commit message when it is/isn't a data update.

Missing LICENSE

I see you have no LICENSE file for this project. The default is copyright.

I would suggest releasing the code under the GPL-3.0-or-later or AGPL-3.0-or-later license so that others are encouraged to contribute changes back to your project.

RSS feed?

Thoughts on producing an rss file of the latest batches to drop?

Filter out older blocks

Filter out blocks over selectable amount of time - for example, older than 1 hour, 5 hours, 1 day

Unable to run python file

Hi, I'm trying to run the python file, but am getting this error: ModuleNotFoundError: No module named 'git'.

I ran pip install -r requirements.txt. Anyone else run into this?

No Issue

Wanted to say thank you to everyone involved.

Thank you!!

More color-coding in tables

image

To make the tables easier to scan, it would be nice if more of the tds were highlighted. For instance, it would be great if the "Block Breakdown" column cells were highlighted according to which candidate won the breakdown.

Move Block Trend next to Hurdle

The use case for me to answer the question 'which states are going to flip?', or 'will my candidate win this state?"

To do this requires hurdle, then finding Block trend, so suggest putting them closer together.

Current:
Block Breakdown | Block Trend | Precincts Reporting | Hurdle

to:
Precincts Reporting | Hurdle | Block Trend | Block Breakdown (this reads better — Biden needs 50%, block trend is 52%)
or
Precincts Reporting | Block Breakdown | Block Trend | Hurdle
or even
In the Lead | Hurdle | Block Trend | Block Breakdown | etc.

Or let me rearrange columns myself!

Thanks again for putting this together. You're amazing!

Images obscuring text

The images of the state flags seem to be obscuring relevant text.
I'm using a Chrome Browser (Version 86.0.4240.111 (Official Build) (64-bit)), and it's looking like this:
image

image

NC oddities?

Perhaps not a coding issue at all, but does anyone have an explanation for the perfect 50.0% - 50.0% vote tallies for North Caroliona? It seems unlikely that new votes would break so precisely and so consistently. Also, some voting blocks have odd numbers of votes, but still 50.0% allocation to each candidate. How is that possible?

Screen Shot 2020-11-05 at 1 22 10 PM

Negative Percent Block Breakdown

PA at 2020-11-05 02:26:44 UTC gives block breakdown as Trump -4.3% / 104.3% Biden. Shouldn't be able to get more than 100% of the votes in a time period?

Screen Shot 2020-11-05 at 3 40 15 PM

Explanation for Block Trend

It would be nice if the UI had a summary of how the block trend is computed. The i tooltip trigger does not actually cause any tooltip to appear on hover.

image

Incorrectly placed table header when scrolling

The table header for each of the states is incorrectly placed when scrolling such that the header is not visible at the top of the table. Either, the top line of the header (the one that says the state's name as well as the current total vote count for each candidate) does not come down with the column labels, or the column labels are positioned so that part of the table is visible above the header.

See image below for demonstration of problem. I am using the latest version of Google Chrome, 1920x1080 resolution.
image

Please let me know if you need any more information. Thanks so much for this awesome resource!

+/- change column

This is an awesome tool, thanks a ton for putting it together. :) If I could be so bold, would you be willing to add a column showing the gain/loss for a candidate for every change? You could make it the gain/loss for the candidate that is behind (but I'm agnostic on that front). I can calculate it in my head but it would be nice to see the exact number.

Totals for each state

Would it be possible to display totals for each candidate in each state? Total votes, percentage and difference between those two sets of number - similar to what standart news networks show in their infographics.

This is greatest tool to watch the trend I saw on the net but I need to switch to CNN and back to get the whole picture.

Live chat/ disocrd server?

I just want to hang out with everybody else who is staying up late and constantly refreshing this site.

Dark mode

Eyes are getting strained, would love a dark mode toggle

Limit rows per state

This is such an awesome resource.

Is there any way we could get the rows per state limited? If not via a UI element, then maybe via URI params or something?

Small markup change could enhance accessibility

Is it please possible to not have the first cell be a th? It forces screen readers to constantly read that out before hearing the value of each cell, which is all but unusable, and this data is otherwise so well structured.

So, where it says:
Arizona (EV: 11)

Can that please be a td or hopefully a caption, but just not a th please? That one fix, an 'h' to a 'd' will enable blind folks to hear this data so much more easily.

I would file a PR, but since I'm blind I don't know if I'll mess up your styling with the markup change.

Thanks in advance!

Option to hide boring states

NV & NC haven’t changed in ages. The ability to hide certain states, that would persist through a refresh, would save real estate.

Great work so far!

Summary Table on top of page

This is an awesome resource, thank you for putting it together. Is it possible to add a table to the top of the page with each state's most recent update?

Timestamp column in HTML view does not adjust to local timezone

Currently the timestamp is associated with the UTC timezone, but is not being adjusted based on the browser's timezone. This causes timestamps to be displayed as times in the future for US time zones. See:

tz-issue

Would be good to add some simple javascript to offset based on browser timezone or use a US timezone for easy adjustment.

In summary at top, show current leader and indicate current predicted winner

Thanks for making this!

Although it's not accurate, I think all of us are trying to figure out where the states are going to end up, and by how much margin.

So suggest something like this:

Arizona: Biden leads with 1,000,000 votes. Current trend with 10,000 votes remaining will have Trump winning by 300 votes.

No Change Update?

I'm observing Georgia and the last 6 updates have decreased the remaining votes left to count, but zero change. Is something up with the code or is it reporting erroneous data?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.