Skip to content

Instantly share code, notes, and snippets.

View elrasguno's full-sized avatar

Dan Racanelli elrasguno

View GitHub Profile
@elrasguno
elrasguno / 538.sh
Created October 17, 2016 03:06 — forked from mmaelzer/538.sh
Bash script to fetch latest polls-only forecast from fivethirtyeight.com. Defaults to US but allows an optional state argument.
#!bin/bash
# Fetches data from http://projects.fivethirtyeight.com/2016-election-forecast/summary.json,
# parses the results using python, and prints the polls-only forecast results in the format:
# "{STATE} D {PROBABILITY} R {PROBABILITY}"
#
# The script takes an optional argument that specifies an individual two letter abbreviation (case insensitive)
# of a U.S. state. By default, the state is US which returns the national results.
#
# Examples: