Skip to content

Commit

Permalink
add owm to README, rename wwo ref
Browse files Browse the repository at this point in the history
  • Loading branch information
schachmat committed Mar 21, 2017
1 parent 8fd3312 commit cc77e59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
8 changes: 4 additions & 4 deletions backends/worldweatheronline.com.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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{}
}

0 comments on commit cc77e59

Please sign in to comment.