This is just a simple Sinatra app that fetches earthquake information from http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M1.txt and can be fetched through an API.
- The app uses PostgreSQL. You will need to create a database for your development and test environments.
CREATE DATABASE quakeapi_development;
CREATE DATABASE quakeapi_test;
-
Make sure tests are passing correctly by running
rake spec
. -
There's a Rackup file already included, so you can start the app by running
rackup config.ru
. -
To import earthquake information from http://earthquake.usgs.gov/earthquakes/catalogs/eqs7day-M1.txt, run
rake quakeapi:fetch_new
. You can run this at any time, and it will only import new earthquake information.
-
Make sure you set up a database with
heroku addons:add heroku-postgresql:dev
and establish it as your primary database withheroku pg:promote HEROKU_POSTGRESQL_COLOR_URL
(whereHEROKU_POSTGRESQL_COLOR_URL
is the setting that Heroku provided when setting up the database add-on). You can find more info in Heroku's PostgreSQL docs -
To continuously add new earthquake information, you can set up Heroku Scheduler to run the
rake quakeapi:fetch_new
task automatically.