Taken from CodePen website :
What Will Change
Beginning June 1, 2017:
Every page on CodePen will be served over HTTPS.
Requests that come in over HTTP will be redirected to HTTPS.
We’ll attempt to request an HTTPS version of any content linked via HTTP. If an HTTPS version is available, we’ll load that content over HTTPS. If not, the content may fail to load (more details below).
Therefore we cannot use the second method proposed on freecodecamp :
Use an Internet Protocol API to get user location (ex. IP-API) and then use the OpenWeatherMap API for the weather. Be sure to connect to CodePen.io via http://.
Correct me if I’m wrong.