Forecast.io API wrapper in Go (Golang)
Go
Pull request Compare This branch is 1 commit ahead, 36 commits behind mlbright:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
v2
.DS_Store
README.md

README.md

forecast

Forecast.io v2 API wrapper in Go (Golang)

Documentation: https://developer.forecast.io/docs/v2

Example usage:

package main

import (
    "fmt"
    forecast "github.com/mlbright/forecast/v2"
    "io/ioutil"
    "log"
    "strings"
)

func main() {

    keybytes, err := ioutil.ReadFile("api_key.txt")
    if err != nil {
        log.Fatal(err)
    }
    key := string(keybytes)
    key = strings.TrimSpace(key)

    lat := "43.6595"
    long := "-79.3433"

    f := forecast.Get(key, lat, long, "now")
    fmt.Println(f.Timezone)
    fmt.Println(f.Currently.Summary)
    fmt.Println(f.Currently.Humidity)
    fmt.Println(f.Currently.Temperature)
    fmt.Println(f.Flags.Units)
    fmt.Println(f.Currently.WindSpeed)
}