weather

package module
v0.0.0-...-7f93820 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2017 License: MIT Imports: 15 Imported by: 0

README

go-weather

weather report in Japan

Install

go get -u github.com/nocd5/go-weather/cmd/wnc

Usage

$ wnc today 仙台

$ wnc week 仙台

$ wnc list 仙台
$ wnc week 34392

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets = assets.NewFileSystem(map[string][]string{"/": []string{"asset"}, "/asset": []string{"ame_master.csv"}}, map[string]*assets.File{
	"/": &assets.File{
		Path:     "/",
		FileMode: 0x800001ff,
		Mtime:    time.Unix(1497663296, 1497663296165353900),
		Data:     nil,
	}, "/asset": &assets.File{
		Path:     "/asset",
		FileMode: 0x800001ff,
		Mtime:    time.Unix(1497663290, 1497663290511468400),
		Data:     nil,
	}, "/asset/ame_master.csv": &assets.File{
		Path:     "/asset/ame_master.csv",
		FileMode: 0x1b6,
		Mtime:    time.Unix(1497429917, 1497429917000000000),
		Data:     []byte(_Assetsdb720aa65c3badd62defb1971f131031472883c3),
	}}, "")

Assets returns go-assets FileSystem

View Source
var TelopList = map[int]string{}/* 126 elements not displayed */

Functions

func FindLocId

func FindLocId(keyword []string) []int

func Observatory

func Observatory() map[int]map[string]string

Types

type WeatherNews

type WeatherNews struct {
	URL         string
	Observatory map[string]string

	Date struct {
		Last struct {
			Month  int `xml:"month"`
			Date   int `xml:"date"`
			Hour   int `xml:"hour"`
			Minute int `xml:"minute"`
		} `xml:"last"`
		Next struct {
			Month  int `xml:"month"`
			Date   int `xml:"date"`
			Hour   int `xml:"hour"`
			Minute int `xml:"minute"`
		} `xml:"next"`
		Week struct {
			Date    []int `xml:"date"`
			Day     []int `xml:"day"`
			Holiday []int `xml:"holiday"`
		} `xml:"week>day"`
	} `xml:"date"`
	Data struct {
		AreaNo int `xml:"areaNo,attr"`
		Day    struct {
			StartHour  int `xml:"startHour,attr"`
			StartYear  int `xml:"startYear,attr"`
			StartMonth int `xml:"startMonth,attr"`
			StartDate  int `xml:"startDate,attr"`
			StartDay   int `xml:"startDay,attr"`
			Weather    struct {
				Hour []int `xml:"hour"`
			} `xml:"weather"`
			Temperature struct {
				Unit string `xml:"unit,attr"`
				Hour []int  `xml:"hour"`
			} `xml:"temperature"`
			Precipitation struct {
				Unit string `xml:"unit,attr"`
				Hour []int  `xml:"hour"`
			} `xml:"precipitation"`
		} `xml:"day"`
		Week struct {
			Weather struct {
				Day []int `xml:"day"`
			} `xml:"weather"`
			Temperature struct {
				Unit string `xml:"unit,attr"`
				Day  []struct {
					Max int `xml:"max"`
					Min int `xml:"min"`
				} `xml:"day"`
			} `xml:"temperature"`
			ChanceOfRain struct {
				Unit string `xml:"unit,attr"`
				Day  []int  `xml:"day"`
			} `xml:"chance_of_rain"`
		} `xml:"week"`
	} `xml:"data"`
}

func Get

func Get(loc int) *WeatherNews

Directories

Path Synopsis
cmd
wnc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL