https://github.com/mithereal/ex_gasoline_price
fetch gas rates from gasprices.aaa.com
https://github.com/mithereal/ex_gasoline_price
diesel elixir fetch-gas-rates gasoline gasoline-prices gasprices
Last synced: 4 months ago
JSON representation
fetch gas rates from gasprices.aaa.com
- Host: GitHub
- URL: https://github.com/mithereal/ex_gasoline_price
- Owner: mithereal
- License: mit
- Created: 2018-05-11T17:41:03.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-14T20:33:45.000Z (over 1 year ago)
- Last Synced: 2024-03-14T23:07:35.309Z (over 1 year ago)
- Topics: diesel, elixir, fetch-gas-rates, gasoline, gasoline-prices, gasprices
- Language: Elixir
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GasolinePrice
** Fetch gas rates from gasprices.aaa.com**
[](https://hexdocs.pm/gasoline_price/)
[](https://hex.pm/packages/gasoline_price)
[](https://github.com/mithereal/ex_gasoline_price/blob/master/LICENSE)
[](https://github.com/mithereal/ex_gasoline_price/commits/master)
[](https://github.com/mithereal/ex_gasoline_price)
[](https://coveralls.io/github/mithereal/ex_gasoline_price?branch=main)## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `gasolineprice` to your list of dependencies in `mix.exs`:```elixir
def deps do
[
{:gasoline_price, "~> 0.3.1"}
]
end
```## Usage
```elixir
iex> GasolinePrice.fetch_national_avg()iex> GasolinePrice.fetch_avg_rates("AZ")
```## Standalone
One can create a standalone app via
```bash
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](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/gasoline_price](https://hexdocs.pm/gasoline_price).