/unsignedFriends

A simple facebook tool to match facebook friends against the unsigned ballots list in Oregon for the 2014 elections. #yeson92

Primary LanguageJavaScriptMIT LicenseMIT

README

Find Friends Unsigned Ballots App

My name is Lawrence Whiteside and I created this app today to help the people of Oregon win their right to know if there food comes from pesticide heavy farming practices, otherwise known as GMOS.

Use it to search your facebook friends against the current Contested Ballots List from the Secretary of State’s office.

This is the code to the simple Rails, Jquery based app.

Licensed under the MIT license. Free to use and modify.

Downoad the source from this repo or fork it for yourself.

VERIFICATION

If you’re here to verify this code does what it says it does.

The files you’ll want to look at are all in the app directory.

Specifically:

app/views/home/index.html.erb
app/models/ballots.rb
app/assets/js/application.js
app/controllers/home_controller.rb

Those 4 files contain most of the relevant application code.

INSTALLATION

It’s a Rails 4 app so it’ll need Ruby 2.1.4.

It uses PostgreSQL as it’s database.

It uses git, so install that too.

The data is located in mydb.dump.

It’s a PostGreSQL dump of the 13K person list given to me by Tony Green and the Secretary of State’s office in xslx format. The original file is located in the public directory.

To Setup Locally

git clone https://github.com/lawwantsin/unsignedFriends.git
cd unsignedFriends
bundle install
rake db:create
rake db:migrate
psql find-unsigned_devlopment < mysql.dump
rails s

In Production

Use Heroku. Sign up for an account. Download the toolbelt and run the following:

heroku create your-app-name
git push heroku master
heroku open (to view the site)

Heroku Database

The table is over 10K rows so the database should be at least standard-0

Add an upgrade database with heroku

heroku addons:add pgbackups
heroku addons:add heroku-postgresql:standard-0

That’s covered in this article. devcenter.heroku.com/articles/heroku-postgres-import-export

But the command is something like this.

heroku pgbackups:restore DATABASE 'https://website/mydb.dump'

Address of the data dump needs to be somewhere online.

Not from your local. I uploaded it to S3 for this purpose.

That’s it.

Thanks for reading.

Any questions, EMail me at law@cinemasetfree.com.

Lawrence Whiteside