Coder Social home page Coder Social logo

quakeapi's Introduction

Build Status

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.

Local Setup

  • 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.

Heroku Setup Tips

  • Make sure you set up a database with heroku addons:add heroku-postgresql:dev and establish it as your primary database with heroku pg:promote HEROKU_POSTGRESQL_COLOR_URL (where HEROKU_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.

quakeapi's People

Contributors

dennmart avatar

Watchers

 avatar James Cloos avatar

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.