Giter Site home page Giter Site logo

callyourrep's Introduction

callyourrep

This is a project to help you find and call your members of congress! It's currently a work in progress.

Thanks so much for contributing! To get up-and-building, there are a few things you'll have to do.

Install dependencies

If you are developing on OS X, you will need to get the XCode developer tools xcode-select --install

Download the latest version of MongoDB: https://www.mongodb.com/download

Callyourrep requires several python libraries:

> sudo pip install flask
> sudo pip install flask_pymongo
> sudo pip install flask_sslify
> sudo pip install lxml
> sudo pip install requests
> sudo pip install phonenumbers
> sudo pip install pyyaml
> sudo pip install twilio

Set up app configurations

The application's configurations will be automatically set from variables in your shell environment. You will need to register with the following services and store your keys in environment variables:

  1. Google Maps

Google requires the use of an API key for applications that use Google Maps. You'll need to have a Google login to get an API key: https://developers.google.com/maps/documentation/javascript/get-api-key

Store your Google API key in an environment variable called GOOGLE_API_KEY:

> export GOOGLE_API_KEY="your_key"
  1. Google Analytics

Add your google analytics key to your environment:

> export GOOGLE_ANALYTICS_KEY="your_key"
  1. Twilio

Twilio powers callyourrep's voice over IP services. You'll need to sign up for Twilio here: https://www.twilio.com/try-twilio

Once you have an account you can retrieve your auth token and sid here: https://www.twilio.com/console

Store them in environment variables:

> export TWILIO_ACCOUNT_SID="your_key"
> export TWILIO_AUTH_TOKEN="your_key"

Next, you'll need to purchase a Twilio phone number to use to make outgoing calls. Once you do that, store it here:

> export TWILIO_OUTGOING_NUMBER="1234567890"

Finally, generate a new app id for this project, and then add it to your environment:

> export TWILIO_APP_SID="your_key"

Seeding the database

To seed the database, start up a mongod on port 27107, and run the import script:

> ./mongod
> python import.py

You'll also need to create a topics collection in the app database and create a text index on it. First, open the mongo shell:

> ./mongo
shell> use app
shell> db.topics.createIndex({ text: "text" })

You can then insert your own call scripts into the app.topics collection by expressing them as documents of the following form:

{
   title : "The Best Issue Ever",
   text : "Hey there <Senator> I just wanted to tell you about this topic",
   useCount : 0,
   searchCount : 0,
   callCount : 0
}

Running the server

Start up your mongod on port 27017, then run the server:

> ./mongod
> python app.py

callyourrep's People

Contributors

jaybarnes avatar jbreams avatar samantharitter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

samantharitter

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.