MSN Weather API

Vote 0 Votes

從 3/22 開始, 使用 Google Weather API 就抓不到台中的資料, 不曉得為什麼, 其他城市正常
只好改用 MSN 的 API, 回傳的結果一樣是 XML
wc: 後面接城市代碼, 上例 TWXX0019 就是台中, weadegreetype=C 是℃
其他城市代碼可以在 找到,
這裡 也有人貼了清單

使用 PHP 取得台中的溫度、濕度
$xml = simplexml_load_file('');
$current = $xml->xpath("/weatherdata/weather");

Leave a comment

About this Entry

This page contains a single entry by Pank published on March 31, 2011 2:19 PM. was the previous entry in this blog.

Atheros AR8131 ethernet driver for CentOS 5.5 x86_64 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives