http://www.google.com/ig/api?hl=zh_cn&weather=城市名称(拼音)
它将返回一个用xml封装的天气信息。
示例:
http://www.google.com/ig/api?hl=zh_cn&weather=shanghai
返回:
<?xml version="1.0" ?>
-
<
weather
module_id
="
0
"
tab_id
="
0
"
mobile_row
="
0
"
mobile_zipped
="
1
"
row
="
0
"
section
="
0
"
>
<
city
data
="
Shanghai, Shanghai
"
/>
<
postal_code
data
="
shanghai
"
/>
<
latitude_e6
data
="
"
/>
<
longitude_e6
data
="
"
/>
<
forecast_date
data
="
2010-08-30
"
/>
<
current_date_time
data
="
2010-08-30 17:00:00 +0000
"
/>
<
unit_system
data
="
SI
"
/>
</
forecast_information
>
<
condition
data
="
多云
"
/>
<
temp_f
data
="
84
"
/>
<
temp_c
data
="
29
"
/>
<
humidity
data
="
湿度: 62%
"
/>
<
icon
data
="
/ig/images/weather/cn_cloudy.gif
"
/>
<
wind_condition
data
="
风向: 东北、风速:7 米/秒
"
/>
</
current_conditions
>
<
day_of_week
data
="
周一
"
/>
<
low
data
="
27
"
/>
<
high
data
="
33
"
/>
<
icon
data
="
/ig/images/weather/chance_of_rain.gif
"
/>
<
condition
data
="
可能有雨
"
/>
</
forecast_conditions
>
<
day_of_week
data
="
周二
"
/>
<
low
data
="
26
"
/>
<
high
data
="
34
"
/>
<
icon
data
="
/ig/images/weather/chance_of_storm.gif
"
/>
<
condition
data
="
可能有暴风雨
"
/>
</
forecast_conditions
>
<
day_of_week
data
="
周三
"
/>
<
low
data
="
26
"
/>
<
high
data
="
33
"
/>
<
icon
data
="
/ig/images/weather/chance_of_storm.gif
"
/>
<
condition
data
="
可能有暴风雨
"
/>
</
forecast_conditions
>
<
day_of_week
data
="
周四
"
/>
<
low
data
="
26
"
/>
<
high
data
="
34
"
/>
<
icon
data
="
/ig/images/weather/chance_of_rain.gif
"
/>
<
condition
data
="
可能有雨
"
/>
</
forecast_conditions
>
</
weather
>
</
xml_api_reply
>
转载请注明:来自ChnCMS
本文地址:http://www.chncms.com/2010/08/30/GOOGLEAPIWEATHER.html