Socket
Socket
Sign inDemoInstall

github.com/CombatMage/openweatherapi

Package Overview
Dependencies
3
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/CombatMage/openweatherapi

Package openweatherapi contains helper functions to query OpenWeatherMaps (http://openweathermap.org/) for weather information. Currently the current weather API (http://openweathermap.org/current) and the 5 days forecast API (http://openweathermap.org/forecast5) are supported.


Version published

Readme

Source

go - openweatherapi

This Repo contains golang library to query OpenWetherMaps (http://openweathermap.org/) for weather information.

Install

 $ go get github.com/CombatMage/openweatherapi

Documentation

Is available on godoc:

https://godoc.org/github.com/CombatMage/openweatherapi

Examples

Consuming the library:

// create a query
q := NewQueryForCity(readAPIKey(), "Berlin,de")

// obtain data
resp, err := q.Weather()

// enjoy
fmt.Println(resp.Name) // Berlin
fmt.Println(resp.Weather[0].Description) // mis
fmt.Println(resp.Main.Temp) // 1

See the test files for more example.

A simple client for testing is also included:

 $ go build cmd/openweatherclient
 $ openweatherclient -key <OpenWeather API Key> -city Berlin,de

FAQs

Last updated on 30 Oct 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc