wunderground v0.0.9 Wunderground

Wunderground, a basic API wrapper for talking to the Weather Underground HTTP API.

Link to this section Summary

Functions

🗓 Gets the almanac for the given location

🌖 Gets the astronomy for the given location

🔎 Get’s autocomplete suggestions for the given search query

🌤 Gets the current conditions for the given location

📅 Gets the forecast for the given location

🗺 Gets the Geolookup for the given location

Link to this section Functions

Link to this function almanac(query)
almanac(Wunderground.Query.t) ::
  {:ok, Wunderground.Almanac.t} |
  {:error, Wunderground.API.error}

🗓 Gets the almanac for the given location.

Parameters

Example

{:ok, almanac} = Wunderground.almanac({:airport, "KJFK"})
Link to this function astronomy(query)
astronomy(Wunderground.Query.t) ::
  {:ok, Wunderground.Astronomy.t} |
  {:error, Wunderground.API.error}

🌖 Gets the astronomy for the given location.

Parameters

Example

{:ok, astronomy} = Wunderground.astronomy({:geo, 37.8, -122.4})
Link to this function autocomplete(query, options \\ [])
autocomplete(String.t, Wunderground.Autocomplete.options) ::
  {:ok, Wunderground.Autocomplete.t} |
  {:error, Wunderground.API.error}

🔎 Get’s autocomplete suggestions for the given search query.

Parameters

Examples

# without options
{:ok, autocomplete} = Wunderground.autocomplete("San Fra")

# search only in Germany
{:ok, autocomplete} = Wunderground.autocomplete("Fra", [{:country, "DE"}])

# include Hurricanes
{:ok, autocomplete} = Wunderground.autocomplete("Arlen", [:with_hurricanes])

# include Hurricanes and exclude cities
{:ok, autocomplete} = Wunderground.autocomplete("Harvey", [:with_hurricanes, :without_cities])
Link to this function conditions(query)
conditions(Wunderground.Query.t) ::
  {:ok, Wunderground.Conditions.t} |
  {:error, Wunderground.API.error}

🌤 Gets the current conditions for the given location.

Parameters

Example

{:ok, conditions} = Wunderground.conditions({:us, "CA", "San_Francisco"})
Link to this function forecast(query)
forecast(Wunderground.Query.t) ::
  {:ok, Wunderground.Forecast.t} |
  {:error, Wunderground.API.error}

📅 Gets the forecast for the given location.

Parameters

Example

{:ok, forecast} = Wunderground.forecast({:pws, "KCASANFR70"})
Link to this function geolookup(query)
geolookup(Wunderground.Query.t) ::
  {:ok, Wunderground.Geolookup.t} |
  {:error, Wunderground.API.error}

🗺 Gets the Geolookup for the given location.

Parameters

Example

{:ok, geolookup} = Wunderground.geolookup({:international, "Australia", "Sydney"})