Q:

Weather forecast from WOEID (using YQL or rss) in javascript?

Is there any way of getting the weather forecast from woeid in javascript?
I tried using rss feed of yahoo, but couldn't get it to work. here is my code
    var url = "http://weather.yahooapis.com/forecastrss?w=" + encodeURIComponent('WOEID here');

    $.ajax({
        url: url,
        dataType: 'jsonp',
        jsonpCallback: function(data) { console.log(data); },
        success: function(data) { alert("success"); }
    });

Any suggestions?

A:

Here's the simplest way to get the info you want using jQuery and YQL:
var woeid = "26355493";

var $url = "http://query.yahooapis.com/v1/public/yql?callback=?";

$.getJSON($url, {
    q: "select * from xml where url=" +
       "\"http://weather.yahooapis.com/forecastrss?w=" + woeid + "\"",
    format: "json"
  }, function (data) {
    console.log(data.query.results.rss.channel);
  }
);​

The query in the YQL console...
The JavaScript code in jsfiddle...

