views:

640

answers:

1

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

+1  A: 

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/

Ivo Sabev
Thanks. It says I need to send through a WOEID... how do I find my WOEID from lat/lon?
Chris Armstrong
You can either switch to their Geo location API or use some of the workarounds here - http://stackoverflow.com/questions/2093358/receive-a-woeid-by-lat-long-with-yahoos-api
Ivo Sabev
Updated my question there with some sample jQuery code, don't suppose you'd know what I'm doing wrong?
Chris Armstrong
Since Yahoo is using Weather Channel data I guess you can directly hook up with them - http://www.weather.com/services/xmloap.html
Ivo Sabev