I am unable to figure out how to start with the project and troubling with the APIs ,
i need some guidance on how to start the project and how to be better in the APIs use.
thanks in advance!
I am unable to figure out how to start with the project and troubling with the APIs ,
i need some guidance on how to start the project and how to be better in the APIs use.
thanks in advance!
Review the “JSON APIs and Ajax” challenges.
For the weather app there are three major steps. 1st is to get the client location. 2nd is to call the weather api passing the client location info and 3rd is to show to the client the response you receive from the weather api.
1st thing first: here you can use two approaches, geolocation or ip location or both, one as a fallback of the other
2nd as for the weather api, there are plenty of free weather apis you may try
3rd how you would present the results its all on your imagination
to get a person’s location…
https://www.w3schools.com/html/html5_geolocation.asp
for a weather api … you can use the challenge one
( not working, but good enuff to pass challenge),
or use another.
I used Yahoo’s … with a call something like this…
var MYwoeid =
"https://query.yahooapis.com/v1/public/yql?q=select woeid from geo.places where text=\"(" +lat+ "," + long+ ")\"&format=json&callback=?";
to get a WOEID (Where On Earth IDentifier) then use the woeid that yahoo returns
wo = data.query.results.place.woeid;
and do a get request with it kinda like so…
var getWeather =
"https://query.yahooapis.com/v1/public/yql?q=select * from weather.forecast where woeid = "+wo+"&format=json";
then parse the data out how you like…
temp = data.query.results.channel.item.condition.temp;
hope this helps a little?