Project

mygasfeed

0.0
No commit activity in last 3 years
No release in over 3 years
Provides a Ruby gem wrapper for MyGasFeed API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
~> 10.0
>= 0

Runtime

 Project Readme

Mygasfeed

Ruby API client for www.mygasfeed.org

Installation

Add this line to your application's Gemfile:

gem 'mygasfeed'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mygasfeed

Obtaining an API Key

You need to get an API key from here.

You can use it by setting an environment variable from the command line

export MYGASFEED_API_KEY=your_api_key

Use it when running rails s

MYGASFEED_API_KEY=your_api_key rails s

Or store it in a .env file and either use Foreman or the dotenv gem.

MYGASFEED_API_KEY=your_api_key

Usage

Get nearby stations

Params: latitude, longitude, distance, fuel_type, sort_by
distance - number of miles
fuel_type - "reg", "mid", "pre", or "diesel".
sort_by - "distance" or "price".

Mygasfeed.get_stations 39.7400, -121.8356, 50, "reg", "distance"

Get price history for a station

Params: station_id

Mygasfeed.get_history 33862

Get details for a station

Params: station_id

Mygasfeed.get_details 33862

Get a list of all gas station brands

Params: none

Mygasfeed.get_brands

Update a gas price

Params: price, fuel_type, station_id
fuel_type - "reg", "mid", "pre", or "diesel".

Mygasfeed.update_price 4.15, "reg", 33862

Get an address by latitude and longitude

Params: latitude, longitude

Mygasfeed.get_adddress 39.7400, -121.8356

Get stations close by another station

Params: station_id, limit
limit - number of miles

Mygasfeed.get_close_by 33862, 50

Contributing

  1. Fork it ( https://github.com/mwiley/mygasfeed/fork )
  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 a new Pull Request