1

I don't know if this is the place for this question, but here's the problem:

I have an web app that fetch weather data from various brazilian cities using Yahoo Weather API. Basically, I got all woeid numbers from this site: http://woeid.rosselliot.co.nz/. After I got all woeid numbers, I've created a web page that makes a ajax call (through jQuery) to fetch all weather info:

var woeid = 455997;
var url_yahoo = "http://weather.yahooapis.com/forecastrss?w=" + woeid + "&u=c";
$.ajax({
    url: 'http://ajax.googleapis.com/ajax/services/feed/load?output=xml&v=1.0&callback=?&q=' + encodeURIComponent(url_yahoo),
    dataType: 'json',
    cache: false,
    success: function(data) {
        data = $(data.responseData.xmlString).find("item");
        var condition_node = $(data).find("yweather\\:condition");
        var forecasts_node = {
            "today": $(data).find("yweather\\:forecast").eq(0),
            "tomorrow": $(data).find("yweather\\:forecast").eq(1),
            "after_tomorrow": $(data).find("yweather\\:forecast").eq(2)
        }
        var temperatures = {
            "today": {
                "now": condition_node.attr("temp"),
                "min": (forecasts_node['today']).attr("low"),
                "max": (forecasts_node['today']).attr("high")
            },
            "tomorrow": {
                "min": (forecasts_node['tomorrow']).attr("low"),
                "max": (forecasts_node['tomorrow']).attr("high")
            },
            "after_tomorrow": {
                "min": (forecasts_node['after_tomorrow']).attr("low"),
                "max": (forecasts_node['after_tomorrow']).attr("high")
            }
        }
        console.log( temperatures['today'] );
    }
})

The example above can fetch all temperatures from various cities. All I need to do is change WOEID number on the variable with the same name. The city with WOEID number of 455997 is Sobral - CE - Brazil. Basically, this ajax call will open the url "weather.yahooapis.com/forecastrss?w={WOEID_NUMBER}&u=c", extract all info from resulting XML file, and show on browser's console all temperatures, as shown below:

Object {now: 38, min: 25, max: 32}

It was working fine last year, with all temperatures being shown inside "temperatures" array variable. But around two months ago, it stopped working, returning 'undefined' on all indexes.

Object {now: undefined, min: undefined, max: undefined}

For debugging purposes, I tried the url that is loaded by ajax (http://weather.yahooapis.com/forecastrss?w=455997&u=c). Yahoo should return me all forecast info related to Sobral - CE - Brazil, but instead it returns me the XML below:

<rss xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" version="2.0">
    <channel>
        <title>Yahoo! Weather - Error</title>
        <description>Yahoo! Weather Error</description>
        <item>
            <title>City not found</title>
            <description>Weather Data not Available at the moment</description>
        </item>
    </channel>
</rss>

Thus, my webapp can't fetch any weather info related to my city. The same issue is happening with another brazilian cities, such as below:

Sobral, Ceara, Brazil - WOEID 455997
Tianguá, Ceara, Brazil - WOEID 453622
São Benedito, Ceará, Brazil - WOEID 449511
Ubajara, Ceara, Brazil - WOEID 454340
Viçosa, Ceara, Brazil - WOEID 461578
Guaraciaba do Norte, Ceara, Brazil - WOEID 452761

For your information, the same issue is happening on iOS 5's weather app. It can't show info about some of the cities above, and it was working fine a few months ago.

I can't find any recent info about this issue. I don't know if it's something temporary, or if it means that the service is going to be discontinued on the future. Is anyone having this same issue as me?

  • WOEISYOU. Also, isn't this better asked towards Yahoo? – bzlm Feb 18 '14 at 21:00
  • 1
    I've edited my question providing more details to show it's a question about programming. Dunno if Stackoverflow is the best place to solve my issue, but can you provide me a link to a place on Yahoo that I can post this question too? – Leonardo Montenegro Feb 24 '14 at 14:47
  • @LeonardoMontenegro the link http://weather.yahooapis.com/forecastrss?w=455997&u=c works now - perhaps it was a bug at yahoo? It returns valid XML stating today it's between 23 and 33 C. – Mousey Aug 13 '15 at 22:45

0 Answers0