/elixir-metex

Example weather application from The Little Elixir OTP Guide book

Primary LanguageElixir

Metex

Simple weather application from the The Little Elixir OTP Guidebook.

Part of my Elixir study.

Example usage:

iex -S mix
iex(5)> cities = ["Chicago", "Toronto", "Vancouver"]
["Chicago", "Toronto", "Vancouver"]
iex(6)> Metex.temperatures_of(cities)
:ok
Chicago: -6.5°C, Toronto: -5.0°C, Vancouver: 0.1°C
iex(7)> flush
:ok

Config

You need to create file config/secrets.exs with openweathermap API key as follows:

use Mix.Config
config :metex, API_KEY: "XXXX"

Installation

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

def deps do
  [
    {:metex, "~> 0.1.0"}
  ]
end

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