Gasrate
Fetch gas rates from gasprices.aaa.com
Installation
If available in Hex, the package can be installed
by adding gasrate
to your list of dependencies in mix.exs
:
def deps do
[
{:gasrate, "~> 0.3.0"}
]
end
Usage
iex> Gasrate.fetch_national_avg()
iex> Gasrate.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/gas_rate /usr/local/bin/.
gas_rate "CA"
{"diesel":6.754,"mid":6.423,"premium":6.561,"regular":6.246}
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/gasrate.