Code Monkey home page Code Monkey logo

sandy's Introduction

Disclaimer

11/10/13 - I have not been maintaining this gem, and I'm not sure that the Coned endpoints are still available. It may not work as expected.

Sandy

Build Status Code Climate

Sandy is a rubygem for consuming power outage data for the Greater New York area. For a given area, retrieve number of outages, as well as total customers, lat/lng, and estimated time of recovery (depending on the provider).

Currently supports ConEd (NYC), LIPA (Long Island), and PSEG (NJ).

Usage

Providers

Sandy::Provider::LIPA::Report.new
Sandy::Provider::ConEd::Report.new

Areas

Area#name
Area#customers_affected
Area#region
Area#latitude
Area#longitude
Area#total_customers
Area#estimated_recovery_time

Example

report = Sandy::Provider::ConEd::Report.new

areas = report.areas
areas.each do |area|
  puts "#{area.name}, #{area.customers_affected}"
end

# => 

Bronx, 28644
Brooklyn, 37016
Manhattan, 226225
Queens, 85057
Staten Island, 58043
Westchester, 123571

A note on Polling

The ConEd outage feed is only updated every 15 minutes. Repeated polling won't get you new results.

Installation

Add this line to your application's Gemfile:

gem 'sandy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sandy

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Powered by the sandy gem

sandy's People

Contributors

ckundo avatar jpettersson avatar

Stargazers

Timothy Spann avatar Angus H. avatar JT5D avatar TJ (Thomas J.) Biddle avatar Han Kang avatar Ben Evans avatar EJ Fox avatar  avatar Trace Wax avatar Kevin Sheurs avatar Dan Feidt avatar Juanje Ojeda avatar Edward Vielmetti avatar Grant Hutchins avatar

Watchers

 avatar James Cloos avatar  avatar

sandy's Issues

new provider support

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.