GitXplorerGitXplorer
c

sandy

public
14 stars
4 forks
2 issues

Commits

List of commits on branch master.
Unverified
f5e57a13e3f1e7c36070aab23a9af105b99eb8f1

Update README.md

committed 11 years ago
Unverified
58dc8e76758ea877d580a785d69e597848576189

Update README.md

committed 11 years ago
Unverified
8e576db2e6947a6b90b42f8accf11c1a57d21e58

Bump to 0.0.7

cckundo committed 12 years ago
Unverified
f8e2a3b035ef1fe0d370a07e70b252db0d669713

Critical fix for estimated recovery time on areas

cckundo committed 12 years ago
Unverified
b1b059a8e4fe8ad32ea2213236b78e8fdd309886

Fix Report json generation.

cckundo committed 12 years ago
Unverified
10aeea38f2978684f0015a1664af867d9bee4db3

Make area json specs more fine grained.

cckundo committed 12 years ago

README

The README file for this repository.

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