GithubHelp home page GithubHelp logo

election-2016-loader's Introduction

Election 2016 Loader

##About A loader that collects election results from AP API and loads them into MySQL. Inspiration for some of this repo was taken from NPR's Elex Loader.

##Requirements

  • MySQL
  • jq

##Configuration Set the following environment variables:

$ export AP_API_KEY='YOUR_AP_API_KEY'
$ export ELECTIONS_DB_HOST='YOUR_MYSQL_HOST'
$ export ELECTIONS_DB_USER='YOUR_MYSQL_USERNAME'
$ export ELECTIONS_DB_PASS='YOUR_MYSQL_PASSWORD'
$ export ELECTIONS_DB_PORT='YOUR_MYSQL_PORT'
$ export MYSQL_COMMAND='mysql'

Note: This loader is programmed to use a database named 'election2016'.

##Installation

$ git clone https://github.com/KQED/election-2016-loader.git
$ cd election-2016-loader

##Running the Service Locally

$ mysql.server start
$ source init.sh
$ source results.sh

##Ebextensions The ebextensions folder has two config files which run when deployed to an AWS Elastic Beanstalk instance

  • createdb.config creates the database election2016 if it doesn't exist and drops and creates the APresults table, if it exists. It then indexes the AP data into the APresults table
  • mysqlinstall.config installs mysql and and jq in the Linux server

election-2016-loader's People

Contributors

cynthiaechen avatar syu15 avatar

Watchers

Jason Herring avatar Noah Piper avatar Kevin Cooke avatar James Cloos avatar  avatar Marc O'Brien avatar Colleen avatar  avatar Andrew Griffin avatar  avatar  avatar KQED Git account avatar Sherice Sharp avatar  avatar Connie Jew avatar Audrey Burk avatar

election-2016-loader's Issues

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.