metego

command module
v0.0.0-...-74b776f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

MeteGo

MeteGo uses the openweather package to produce an up to 5 days weather forecast for a city that can be sent to a pushover application (more information on the Go pushover package here).

openweather package

Wrapper around the 5 day / 3 hour forecast OpenWeather API for MeteGo.

Usage

You need to create a tokens.txt file with your tokens where :

  • openweather is your openweather API key
  • pushover is the API token (Application)
  • recipient is your User Key

openweather is the only mandatory token. Pushover tokens are only required if you want to send to Pushover.

openweather youropenweathertoken
pushover yourpushovertoken
recipient yourrecipienttoken
Options
-city <string>    City for the weather forecast
-days <int>       Number of forecasted days - between 1 and 5
-debug            Show debug lines
-pushover         Send the forecast to Pushover

Ouput

Current day is included as part of the forecast. Each line represents a 3 hours slice and is made of:

beginning hour | weather description - humidity - temperature(°C)

example :

$ ./main -city Paris -days 2
INFO    Weather forecast for Paris (2 day(s))
2020-04-15 
15:00:00 | few clouds - h:40% - 20.01°C
18:00:00 | clear sky - h:56% - 17.00°C
21:00:00 | clear sky - h:72% - 12.89°C

2020-04-16 
00:00:00 | clear sky - h:78% - 11.23°C
03:00:00 | scattered clouds - h:82% - 10.08°C
06:00:00 | broken clouds - h:77% - 10.52°C
09:00:00 | overcast clouds - h:54% - 15.89°C
12:00:00 | broken clouds - h:45% - 20.02°C
15:00:00 | scattered clouds - h:46% - 21.68°C
18:00:00 | scattered clouds - h:59% - 18.98°C
21:00:00 | light rain - h:72% - 15.58°C

Todo and upgrades

  • Tests :)
  • Forecast format

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package openweather provides a simple wrapper around the openweather 5 day / 3 hour forecast API for metego
Package openweather provides a simple wrapper around the openweather 5 day / 3 hour forecast API for metego

Jump to

Keyboard shortcuts

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