OpenWeatherMap
godocimport "barista.run/modules/weather/openweathermap"
Provides weather using the OpenWeatherMap API.
Usage
OpenWeatherMap allows several ways of specifying the location. See the OpenWeatherMap API documentation for more details on location specifiers.
-
By City ID. Get City IDs from the OpenWeatherMap city.list.json.gz
weather.New(openweathermap.New("apikey").CityID("2172797"))
-
By City Name
weather.New(openweathermap.New("apikey").CityName("Cairo", "Egypt"))
-
From geographical coördinates, using the standard convention of south and west being negative values, and north and east being positive.
weather.New(openweathermap.New("apikey").Coords(-34.3852, 132.4553))
-
From a postal code (or zip code)
weather.New(openweathermap.New("apikey").Zipcode("SW1A 1AA", "UK"))