Skip to content

A sample Sinatra app that uses the Green Button gem to parse a Green Button data file and graph it using High Charts.

License

Notifications You must be signed in to change notification settings

cew821/gbsample

Repository files navigation

Readme

This is a sample application that uses the Green Button gem to parse data collected from a server that responds to GET requests for Green Button usage points.

It is built using Sinatra and HighCharts, and is merely meant to provide a simple example of the Green Button parser library at work.

Running Locally

You will need Ruby installed.

To run locally, clone the repository, cd into the repo, and run $ bundle install. Then, $ ruby gbsample.rb to start a server. Visit http://localhost:4567/greenbutton to initiate a request to the sample Green Button data endpoint (in this case https://services.greenbuttondata.org/DataCustodian/espi/1_1/resource/Batch/RetailCustomer/1/UsagePoint). Once the file has been loaded from the server, it will be parsed and displayed on the chart.

The action happens in gbsample.rb.

In Production

The app, such as it is, is deployed on Heroku. You can test it by visiting http://gbsample.herokuapp.com/greenbutton.

This software is Open Source. See license.txt for more details.

About

A sample Sinatra app that uses the Green Button gem to parse a Green Button data file and graph it using High Charts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages