1

これがこの質問の場所かどうかはわかりませんが、問題は次のとおりです。

Yahoo Weather API を使用してブラジルのさまざまな都市から気象データを取得する Web アプリがあります。基本的に、私はこのサイトからすべての woeid 番号を取得しました: http://woeid.rosselliot.co.nz/ . すべての woeid 番号を取得したら、(jQuery を介して) ajax 呼び出しを行ってすべての天気情報を取得する Web ページを作成しました。

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'] );
    }
})

上記の例では、さまざまな都市からすべての気温を取得できます。同じ名前の変数の WOEID 番号を変更するだけです。WOEID 番号が 455997 の都市は Sobral - CE - Brazil です。基本的に、この ajax 呼び出しは URL "weather.yahooapis.com/forecastrss?w={WOEID_NUMBER}&u=c" を開き、結果の XML ファイルからすべての情報を抽出し、以下に示すようにブラウザーのコンソールにすべての気温を表示します。

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

昨年は正常に機能しており、すべての温度が「温度」配列変数内に表示されていました。しかし、約 2 か月前に機能しなくなり、すべてのインデックスで「未定義」が返されました。

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

デバッグ目的で、ajax によって読み込まれる URL ( http://weather.yahooapis.com/forecastrss?w=455997&u=c ) を試しました。Yahoo は Sobral - CE - Brazil に関連するすべての予測情報を返すはずですが、代わりに以下の XML を返します。

<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>

したがって、私の webapp は私の都市に関連する天気情報を取得できません。以下のようなブラジルの別の都市でも同じ問題が発生しています。

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

参考までに、iOS 5 の天気アプリでも同じ問題が発生しています。上記の一部の都市に関する情報を表示できません。数か月前は正常に機能していました。

この問題に関する最近の情報は見つかりません。一時的なものなのか、今後サービスが終了するという意味なのかはわかりません。私と同じ問題を抱えている人はいますか?

4

0 に答える 0