dipu-bd / vue-weather-widget

Weather forecast using darksky weather api in vuejs
https://dipu-bd.github.io/vue-weather-widget/
Apache License 2.0
36 stars 16 forks source link

Add support for OpenWeatherMap API #18

Closed nickforddev closed 4 years ago

nickforddev commented 4 years ago

17

I left DarkSky API support intact, and opted to just transform the data from the OpenWeatherMap API to work with this component.

Two questions for you:

  1. Was there a technical reason you chose to use jsonp for the Dark Sky API call? CORS? Would it be better to do the same for OWM?
  2. I added a boolean prop to determine which API to use and set the default to true. I guess I'd make the argument that since the Dark Sky API will eventually be shut down, OWM probably should be the default, on the other hand it is the only real breaking change here, I'm curious to hear your opinion on that. Maybe it's better to use useDarkSkyApi prop with default of false? Still a breaking change, but maybe that's more indicative of what is happening with the APIs?

(screenshots are in imperial units)

Dark Sky:

Screen Shot 2020-08-29 at 11 31 50 AM

OWM

Screen Shot 2020-08-29 at 11 40 01 AM
dipu-bd commented 4 years ago

Thanks for your PR. Here goes the answers to your questions:

  1. There was a good reason, I forgot now however. If json works, you do not need to bother with jsonp.
  2. I think OWM should be the default. I will make the necessary changes after merging your PR.