Skip to content

mithereal/ex_gasoline_price

Repository files navigation

GasolinePrice

** Fetch gas rates from gasprices.aaa.com**

Hex Docs Hex.pm License Last Updated Build Status Coverage Status

Installation

If available in Hex, the package can be installed by adding gasolineprice to your list of dependencies in mix.exs:

def deps do
  [
    {:gasoline_price, "~> 0.3.1"}
  ]
end

Usage

iex>  GasolinePrice.fetch_national_avg()

iex>  GasolinePrice.fetch_avg_rates("AZ")

Standalone

One can create a standalone app via

MIX_ENV=cli && mix deps.get && mix release
cp _build/cli/rel/bakeware/gasoline_price /usr/local/bin/.
gasoline_price "CA"
{"diesel":6.754,"mid":6.423,"premium":6.561,"regular":6.246}

gasoline_price fetch_metro_rates "CA"
[...]

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/gasoline_price.