Search code examples
jquerygeolocationweatherweather-apiyahoo-weather-api

Get weather from Yahoo with jQuery


I'm using the Google API to get a user's location on this site. How would I go about getting the weather for that user from Yahoo or somewhere?

UPDATE: Ok so I'm going with Yahoo, but I've never done an HTTP GET request before. Im using jQuery and the following code:

function getWeather () {
            $.get("http://weather.yahooapis.com/forecastrss?w=2502265", function(data){
               alert("Data Loaded: " + data);
             });
        }

However, the alert is only returning "Data loaded", and the rest is blank, so I'm doing something wrong but not sure what.

Also, I need a way of taking my latitude and longitude and fiding the WOEID for them


Solution

  • Read about Yahoo Weather, you can pass the location as parameter to their API url and it will give you the result:

    http://developer.yahoo.com/weather/