AustinMCrane / go-accuweather

AccuWeather api client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GoDoc Coverage Status Build Status Go Report Card

Current Features

  • text based location lookup
  • geo position location lookup via lat lon
  • daily forecast
  • hourly forecast
  • current conditions (not historic)

Usage:

Current Conditions Example
package main

import (
  "fmt"
  "net/http"

  accuweather "github.com/AustinMCrane/go-accuweather"
)

func main() {
  client := accuweather.NewClient("APIKEY", &http.Client{})

  locations, err := client.CitySearch("LOCATION NAME")
  if err != nil {
    panic(err)
  }

  if len(locations) == 0 {
    fmt.Println(fmt.Sprintf("no locations found for %s", *location))
    return
  }

  locationKey := locations[0].Key
  conditions, err := client.GetCurrentConditions(locationKey)
  if err != nil {
    panic(err)
  }
}

About

AccuWeather api client


Languages

Language:Go 100.0%