-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show the Local Weather - getCurrentPosition not working over http #9145
Comments
You're right, that message is little confusing. Usually you label something as "deprecated" to communicate to your users that it still works, but may be removed in the future. Here these two functions just don't work over http. However, I expect anyone reading this message will figure out themselves to change their url to "https". |
The pen in the challenge uses a resource that itself is served over http. Hence the URL to the pen is kept as http. Although it would be great if someone can point us to a |
Google will not allow you to get geo location anymore over http. And unfortunately the free version of the suggested API to use (Openweathermap) cannot use https unless you pay for it. Instead I would suggest bypassing google altogether to get geolocation and use http://ip-api.com/json to get the information you need based off the IP address. |
@stricknein that is precisely the resource that is used in the pen |
@raisedadead Ok? Point is people are trying to complete the challenge going off what they were taught prior to the challenge and they will not be able to unless the pay for open weather map and know that the issue is from using http and not https. Some one with some time on their hands should add that as a note on the challenge in order to ease people's frustration. I was just pointing out another API that would work with OWM. That was the only one out of several that I tried that was free and got the job done. |
@stricknein There are some other weather APIs available, but they seem to have the same http issue. I think an easy fix to this issue would be to tell people not to use Chrome just for this challenge. Otherwise, is there some API provider that could donate resources to FreeCodeCamp? |
As I said earlier just use the one I mentioned. Free and works well. No On Monday, June 20, 2016, sthodup1 notifications@github.com wrote:
|
As @sthodup1 said, to complete this challenge, avoid Chrome. I used Firefox and set the urls to http and everything was fine for now. |
I'm not installing Mozilla just to complete a challenge and many others On Monday, June 20, 2016, Pedro notifications@github.com wrote:
|
I know this isn't the best solution. And in my opinion you won't be installing just to complete a challenge but as a frontend developer you have to be sure that your code will work exactly the same in all the major browsers. |
If you're using OS X/Windows, you should have Safari/IE available. I agree that the ip-based geolocation is a good solution for people that want to use Chrome. |
Right... Which mine does... Like I said not sure why you guys are so On Monday, June 20, 2016, Pedro notifications@github.com wrote:
|
I have found another weather api that is free and works over https. In my opinion, it would be better to encourage campers to use the geolocation tools over https and then a secure api rather than having them use a workaround (the ip lookup api). Edit: That api doesn't have a city name. This could be used to find city if necessary. |
@RayBB thanks a lot for finding these for us. Just in case if you have been able to use them in a project, we could quickly fork that and replace the existing one. Let us know! |
@raisedadead I managed to make a simple working example. |
As discussed in #9079, forecast.io (Dark Sky) doesn't have city/country in the API, which limits some appeal by showing the user where it's pulling weather from. Also, I'm getting a 500 error on your example @RayBB. So far, the workaround I've found to work best is to prepend: |
Disregard what I just said as I see in the thread for issue #7853 that FCC won't recommend using Note that users will also need to add |
Hi, just finished the code (will now start the design), the solution was easy enough, https://www.wunderground.com API, it's free (but requires registration to get the API Key ... 500 free connections a day if I remember well) and you can get the weather conditions using coordinates with an address like this (but I didn't find it on their instructions): |
@raisedadead, update on this in regards to updating codepen? |
For any of my friends having trouble with this: I was using the IP api and using openweathermap.org, and when i ran it locally as a file saved on my computer it worked fine, when i tried to run it off of codepen, it threw errors at me. Mixed Content: The page at 'https://codepen.io/jaketripp/full/gWdKXz/' was loaded over HTTPS, but requested an insecure script 'http://ip-api.com/json/?callback=blah blah blah'. This request has been blocked; the content must be served over HTTPS. Guess what worked? I went up to the url bar of my codepen and MANUALLY REMOVED THE S from the url. Now it works. go figure. good enough for me. |
The Open Weather Map API was not serving over HTTPS, leading to mixed content issues, since geolocation requires HTTPS. Forecast.io's API is also free, requires sign up, but up to 1k hits per day w/ no charge or card on file. I'm (unsurprisingly) not the first person to notice this. Seems to intersect w/ freeCodeCamp#7853 and freeCodeCamp#9145. squash! updated forecast.io references to 'dark sky' updated forecast.io references to 'dark sky'
The Open Weather Map API was not serving over HTTPS, leading to mixed content issues, since geolocation requires HTTPS. Forecast.io's API is also free, requires sign up, but up to 1k hits per day w/ no charge or card on file. I'm (unsurprisingly) not the first person to notice this. Seems to intersect w/ freeCodeCamp#7853 and freeCodeCamp#9145. squash! updated forecast.io references to 'dark sky' updated forecast.io references to 'dark sky'
Challenge Name
Show the Local Weather
https://www.freecodecamp.com/challenges/show-the-local-weather
Issue Description
getCurrentPosition does not work over http. I think that changing the url to codepen.io in that particular challenge would help others campers not thinking their code isn't correct.
Browser Information
Your Code
// If relevant, paste all of your challenge code in here
Screenshot
The text was updated successfully, but these errors were encountered: