Skip to content

Instantly share code, notes, and snippets.

@mgamini
Last active November 6, 2020 15:25
Show Gist options
  • Save mgamini/dcd41e52a8d594b0e653b5caf69c3e20 to your computer and use it in GitHub Desktop.
Save mgamini/dcd41e52a8d594b0e653b5caf69c3e20 to your computer and use it in GitHub Desktop.
Wyomings calculator
// Nav to the NYT election page:
// https://www.nytimes.com/interactive/2020/11/03/us/elections/results-president.html
// Open developer tools
// Paste the code below
// note: pasting code you don't understand into your browser is very dangerous.
// If you don't understand what this code is doing, don't do it.
const POP_OF_WYOMING = 578759
window.alert(`Biden is winning by ${([...document.querySelectorAll('.e-all-text')].reduce((arr, node) => Math.abs(arr - parseInt(node.innerText.replaceAll(',',''))), 0) / POP_OF_WYOMING).toFixed(2)} Wyomings`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment