https://github.com/codeniko/go-weather
Get city weather information using Golang and the openweathermap API
https://github.com/codeniko/go-weather
Last synced: about 1 year ago
JSON representation
Get city weather information using Golang and the openweathermap API
- Host: GitHub
- URL: https://github.com/codeniko/go-weather
- Owner: codeniko
- Created: 2015-01-27T03:13:17.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T03:16:22.000Z (over 11 years ago)
- Last Synced: 2025-01-21T00:43:40.364Z (over 1 year ago)
- Language: Go
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## go-weather
A simple attempt at programming with Go using the openweathermap API. This is a daemon running in the background that listens to port 8080. When sending the correctly structured HTTP request, weather information about the CITY,STATE you requested about is returned.
Weather information retrieved include: Temperature, humidity, wind speed, and wind direction.
## Building the binary
run "go build"
## Running
1. Make sure you have a solid internet connection so that the weather API can be called successfully.
2. run "./weather" to start the webserver on port 8080 of localhost.
3. In a terminal, run "curl localhost:8080/weather/CITY,STATE"
Example: curl localhost:8080/weather/piscataway,nj
## How data is searched
Do a request against localhost:8080/weather/CITY,STATE where CITY is a city and STATE is the state in which CITY is in. The CITY,STATE is extracted from the url and is used as the argument to search for in the weather API. The API does most of the work to retrieve the data, and I simply return it.