フェッチ条件に Google Weather API と PHP を使用しています。
http://www.google.com/ig/api?weather=New%20York
変更する方法はありますか:
<icon data="/ig/images/weather/partly_cloudy.gif"/>
カスタムイメージに?
フェッチ条件に Google Weather API と PHP を使用しています。
http://www.google.com/ig/api?weather=New%20York
変更する方法はありますか:
<icon data="/ig/images/weather/partly_cloudy.gif"/>
カスタムイメージに?
API(これ<icon data="/ig/images/weather/partly_cloudy.gif"/>
は公式のAPIではありません)によって返されるように、PHPでifステートメントを使用して画像を「置き換える」ことができます。
if($theAPIResponse->icon->attributes()->data == '/ig/images/weather/partly_cloudy.gif') {
// Override the nodes data attribute with your custom image
$theAPIResponse->icon->attributes()->data = '/path/to/your/custom_image.gif';
}
最も簡単な方法は、を使用することstr_replace("google_path","your_path")
です。