o355 / PyWeather

Viewing the weather in a CLI has never been this much fun. (ARCHIVED)
https://gitlab.com/o355/PyWeather
GNU General Public License v3.0
28 stars 8 forks source link

Changed GeoAPI to ipapi.co (#77) #80

Closed BenjaminUrquhart closed 6 years ago

BenjaminUrquhart commented 6 years ago

Nothing else needs to be said. It's all in the title.

Issue #77

BenjaminUrquhart commented 6 years ago

I made this PR just in case you decided to use that particular API. If you don't want to, close it.

o355 commented 6 years ago

Hi, again thanks for the PR. The site looks good, and I'll fully test the code tomorrow.

o355 commented 6 years ago

Currently getting a 429 error. Too many requests. In a web browser it works, though.

Just for the sake of getting PyWeather to 1,000 commits without a hitch, I'll merge this and then take on dealing with the 429 error (probably need a user agent).

Thanks for the PR!

o355 commented 6 years ago

Defining a custom user agent did the trick.

Here goes 1,000 commits!

o355 commented 6 years ago

Things just get weirder. For whatever reason, running PyWeather in Python 3.6.5 always works (Requests 2.9.1), but doesn't work in Python 3.5 (running Requests 2.18.4).

Going to try and change the user agent to just include the PyWeather version.

o355 commented 6 years ago

Silly me...didn't change the headers in reality. Will try again...

o355 commented 6 years ago

Now it works. I'll implement SSL error catching now that this API has the capability to support HTTPS.

I'll also do that for other requests.get statements if I can.