Skip to content

Comment on AP reports US election results via Ethereum blockchain

Comments

Here is a simple script to grab election results from AP via The Guardian. No API key required. No over-enegineered "ELEX" Python scripts. Just request the JSON and do whatever you want with the numbers.

Usage: 1.sh [2-letter state abbrev uppercase]

Example: 1.sh PA

   cat > 1.sh

   #!/bin/sh

   x=$(curl  https://interactive.guim.co.uk/2020/11/us-general-election-data/prod/last_updated.json|sed -n '/"time":/{s/{"time":"//;s/"}//;p;}')
   curl https://interactive.guim.co.uk/2020/11/us-general-election-data/prod/data-out/$x/president_details.json|sed 's/.*\"'"$1"'\"://;s/\"[A-Z][A-Z]\":.*//;s/,/\
   /g;s/"candidates":\[//;'
echo $x
   ^D
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.