** Fetch gas rates from gasprices.aaa.com**
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
iex> GasolinePrice.fetch_national_avg()
iex> GasolinePrice.fetch_avg_rates("AZ")
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.