wunderground v0.0.6 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
Gets the current conditions for the given location
Gets the forecast 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.
Usage
# For the US using {:us, state, city} or {:us_zip, zipcode}
{:ok, almanac} = Wunderground.almanac({:us, "CA", "San_Francisco"})
{:ok, almanac} = Wunderground.almanac({:us_zip, 60290})
# International using {:international, country, city}
{:ok, almanac} = Wunderground.almanac({:international, "Australia", "Sydney"})
# Via coordinates using {:geo, lat, lng}
{:ok, almanac} = Wunderground.almanac({:geo, 37.8, -122.4})
# For an airport using {:airport, airport_code}
{:ok, almanac} = Wunderground.almanac({:airport, "KJFK"})
# For a specific personal weather station using {:pws, pws_id}
{:ok, almanac} = Wunderground.almanac({:pws, "KCASANFR70"})
# For the GeoIP location of the running machine using {:auto_ip}
# or any IP address using {:auto_ip, ip_adress}
{:ok, almanac} = Wunderground.almanac({:auto_ip})
{:ok, almanac} = Wunderground.almanac({:auto_ip, {185, 1, 74, 1}})
Link to this function
astronomy(query)
astronomy(Wunderground.Query.t) :: {:ok, Wunderground.Astronomy.Moonphase.t} | {:error, Wunderground.API.error}
Gets the astronomy for the given location.
Usage
# For the US using {:us, state, city} or {:us_zip, zipcode}
{:ok, astronomy} = Wunderground.astronomy({:us, "CA", "San_Francisco"})
{:ok, astronomy} = Wunderground.astronomy({:us_zip, 60290})
# International using {:international, country, city}
{:ok, astronomy} = Wunderground.astronomy({:international, "Australia", "Sydney"})
# Via coordinates using {:geo, lat, lng}
{:ok, astronomy} = Wunderground.astronomy({:geo, 37.8, -122.4})
# For an airport using {:airport, airport_code}
{:ok, astronomy} = Wunderground.astronomy({:airport, "KJFK"})
# For a specific personal weather station using {:pws, pws_id}
{:ok, astronomy} = Wunderground.astronomy({:pws, "KCASANFR70"})
# For the GeoIP location of the running machine using {:auto_ip}
# or any IP address using {:auto_ip, ip_adress}
{:ok, astronomy} = Wunderground.astronomy({:auto_ip})
{:ok, astronomy} = Wunderground.astronomy({:auto_ip, {185, 1, 74, 1}})
Link to this function
conditions(query)
conditions(Wunderground.Query.t) :: {:ok, Wunderground.Conditions.Observation.t} | {:error, Wunderground.API.error}
Gets the current conditions for the given location.
Usage
# For the US using {:us, state, city} or {:us_zip, zipcode}
{:ok, conditions} = Wunderground.conditions({:us, "CA", "San_Francisco"})
{:ok, conditions} = Wunderground.conditions({:us_zip, 60290})
# International using {:international, country, city}
{:ok, conditions} = Wunderground.conditions({:international, "Australia", "Sydney"})
# Via coordinates using {:geo, lat, lng}
{:ok, conditions} = Wunderground.conditions({:geo, 37.8, -122.4})
# For an airport using {:airport, airport_code}
{:ok, conditions} = Wunderground.conditions({:airport, "KJFK"})
# For a specific personal weather station using {:pws, pws_id}
{:ok, conditions} = Wunderground.conditions({:pws, "KCASANFR70"})
# For the GeoIP location of the running machine using {:auto_ip}
# or any IP address using {:auto_ip, ip_adress}
{:ok, conditions} = Wunderground.conditions({:auto_ip})
{:ok, conditions} = Wunderground.conditions({:auto_ip, {185, 1, 74, 1}})
Link to this function
forecast(query)
forecast(Wunderground.Query.t) :: {:ok, Wunderground.Forecast.Result.t} | {:error, Wunderground.API.error}
Gets the forecast for the given location.
Usage
# For the US using {:us, state, city} or {:us_zip, zipcode}
{:ok, forecast} = Wunderground.forecast({:us, "CA", "San_Francisco"})
{:ok, forecast} = Wunderground.forecast({:us_zip, 60290})
# International using {:international, country, city}
{:ok, forecast} = Wunderground.forecast({:international, "Australia", "Sydney"})
# Via coordinates using {:geo, lat, lng}
{:ok, forecast} = Wunderground.forecast({:geo, 37.8, -122.4})
# For an airport using {:airport, airport_code}
{:ok, forecast} = Wunderground.forecast({:airport, "KJFK"})
# For a specific personal weather station using {:pws, pws_id}
{:ok, forecast} = Wunderground.forecast({:pws, "KCASANFR70"})
# For the GeoIP location of the running machine using {:auto_ip}
# or any IP address using {:auto_ip, ip_adress}
{:ok, forecast} = Wunderground.forecast({:auto_ip})
{:ok, forecast} = Wunderground.forecast({:auto_ip, {185, 1, 74, 1}})