class OpenWeatherMap::Client

Overview

A client for interfacing with the Open Weather Map API.

Defined in:

open_weather_map/client.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(key : String) #

[View source]

Instance Method Detail

def current_weather_for_cities(params : Hash(String, _)) #

Requests current weather information for multiple cities by passing in required parameters as a hash. The Hash must have one of the following sets of keys: lat, lon, cnt : Query for cnt number of cities nearest to the lat and lon coordinates provided. bbox : Query for all cities within a rectangle of coordinates provided. id : Query by a list of city IDs.


[View source]
def current_weather_for_city(params : Hash(String, _)) #

Requests current weather information for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.


[View source]
def five_day_forecast_for_city(params : Hash(String, _)) #

Requests 5 day/3 hour weather forecast for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.


[View source]
def sunrise_sunset_for_city(params : Hash(String, _)) #

Requests sunrise and sunset times for a single city by passing in required parameters as a hash. The Hash must have one of the following sets of keys: q : Querying by the city name. id : Querying by the city ID. lat & lon : Querying by latitudinal and longitudinal values. zip : For American addresses, querying by the zip code.


[View source]