Skip to content

Instantly share code, notes, and snippets.

@david-crespo
david-crespo / fetchPolls.js
Last active March 20, 2019 21:43
Fetch latest polls from 538 and ping IFTTT if there are any
#! /app/.heroku/node/bin/node
"use strict";
const moment = require('moment-timezone');
const request = require('request');
const _ = require('lodash');
const updatesURL = 'http://projects.fivethirtyeight.com/2016-election-forecast/updates.json';
const forecastURL = 'http://projects.fivethirtyeight.com/2016-election-forecast/US.json';
const notificationURL = 'https://maker.ifttt.com/trigger/new_polls/with/key/<YOUR_KEY_HERE>';

Keybase proof

I hereby claim:

  • I am david-crespo on github.
  • I am davidcrespo (https://keybase.io/davidcrespo) on keybase.
  • I have a public key whose fingerprint is F822 6F3D 1723 E9D5 782D 50EF 74DD 327E 01E2 1D5D

To claim this, I am signing this object: