From cc77e5929d377ea090b00788fc1424adb05883ae Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Tue, 21 Mar 2017 03:48:51 +0100 Subject: [PATCH] add owm to README, rename wwo ref --- README.md | 10 +++++++++- backends/worldweatheronline.com.go | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b636900..4c7d861 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,19 @@ go get -u github.com/schachmat/wego location=40.748,-73.985 forecast-api-key=YOUR_FORECAST.IO_API_KEY_HERE ``` +0. __With an [Openweathermap](https://home.openweathermap.org/) account__ + * You can create an account and get a free API key by [signing up](https://home.openweathermap.org/users/sign_up) + * Update the following `.wegorc` config variables to fit your needs: + ``` + backend=openweathermap + location=New York + owm-api-key=YOUR_OPENWEATHERMAP_API_KEY_HERE + ``` 0. __With a [Worldweatheronline](http://www.worldweatheronline.com/) account__ * Worldweatheronline no longer gives out free API keys. [#83](https://github.com/schachmat/wego/issues/83) * Update the following `.wegorc` config variables to fit your needs: ``` - backend=worldweatheronline.com + backend=worldweatheronline location=New York wwo-api-key=YOUR_WORLDWEATHERONLINE_API_KEY_HERE ``` diff --git a/backends/worldweatheronline.com.go b/backends/worldweatheronline.com.go index 9d84384..80a4187 100644 --- a/backends/worldweatheronline.com.go +++ b/backends/worldweatheronline.com.go @@ -248,9 +248,9 @@ func wwoUnmarshalLang(body []byte, r *wwoResponse, lang string) error { } func (c *wwoConfig) Setup() { - flag.StringVar(&c.apiKey, "wwo-api-key", "", "wwo backend: the api `KEY` to use") - flag.StringVar(&c.language, "wwo-lang", "en", "wwo backend: the `LANGUAGE` to request from wwo") - flag.BoolVar(&c.debug, "wwo-debug", false, "wwo backend: print raw requests and responses") + flag.StringVar(&c.apiKey, "wwo-api-key", "", "worldweatheronline backend: the api `KEY` to use") + flag.StringVar(&c.language, "wwo-lang", "en", "worldweatheronline backend: the `LANGUAGE` to request from worldweatheronline") + flag.BoolVar(&c.debug, "wwo-debug", false, "worldweatheronline backend: print raw requests and responses") } func (c *wwoConfig) getCoordinatesFromAPI(queryParams []string, res chan *iface.LatLon) { @@ -373,5 +373,5 @@ func (c *wwoConfig) Fetch(loc string, numdays int) iface.Data { } func init() { - iface.AllBackends["worldweatheronline.com"] = &wwoConfig{} + iface.AllBackends["worldweatheronline"] = &wwoConfig{} }