lorepirri / open-weather-map-proxy

OpenWeatherMapProxy is a simple proxy for the Open Weather Map: client can use it with no need to expose its appid key, which should be kept private. I originally coded it to be able to finish a freeCodeCamp challenge (Show Local Weather). If it is useful to you as well, STAR it please!
MIT License
1 stars 0 forks source link

Add JSONP / callback support #1

Open lorepirri opened 7 years ago

lorepirri commented 7 years ago

The OWM supports also JSONP Callback.

lorepirri commented 7 years ago

using callback=testme the OWM response looks like testme({ ... })

example: testme({"coord":{"lon":13.41,"lat":52.52},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"base":"stations","main":{"temp":282.66,"pressure":1008,"humidity":87,"temp_min":282.15,"temp_max":283.15},"visibility":10000,"wind":{"speed":3.6,"deg":280},"clouds":{"all":90},"dt":1492012200,"sys":{"type":1,"id":4892,"message":0.1404,"country":"DE","sunrise":1491970421,"sunset":1492020077},"id":2950159,"name":"Berlin","cod":200})