简单的雅虎天气Api不工作

Cru*_*lyr 2 api yahoo weather

我正在使用一个简单的代码,其中包含一个雅虎api代码,以获取我的城市的天气,并放入我的网页,但是,我只是读到雅虎公共api不再工作,我不知道怎么能得到这个代码工作,我有一个雅虎帐户,我创建了一个API,我不知道如何继续,因为在这里.如果有人可以帮助我,这就是代码:

<?php
/*Clima*/
if(isset($_POST['zipcode']) && is_numeric($_POST['zipcode'])){
    $zipcode = $_POST['zipcode'];
}else{
    $zipcode = 'ARMA0056';
}
$result = file_get_contents('http://weather.yahooapis.com/forecastrss?p=' . $zipcode . '&u=c');
$xml = simplexml_load_string($result);

//echo htmlspecialchars($result, ENT_QUOTES, 'UTF-8');

$xml->registerXPathNamespace('yweather', 'http://xml.weather.yahoo.com/ns/rss/1.0');
$location = $xml->channel->xpath('yweather:location');

if(!empty($location)){
    foreach($xml->channel->item as $item){
        $current = $item->xpath('yweather:condition');
        $forecast = $item->xpath('yweather:forecast');
        $current = $current[0];
        $clima = <<<END
           <span>{$current['temp']}&deg;C</span>

END;
    }
}else{
    $clima = '<h1>No results found, please try a different zip code.</h1>';
}
/*Clima*/
?> 
Run Code Online (Sandbox Code Playgroud)

小智 10

刚刚替换http://weather.yahooapis.comhttp://xml.weather.yahoo.com.学分为https://forum.rainmeter.net/viewtopic.php?f=13&t=23010