Advantage: Data and style separation
Disadvantage: not complete. City retrieval is not supported.
Google Code: http://code.google.com/p/weather-china/
Weather-China encapsulates weather RSS feed provided by Yahoo and provides a rest API interface in JSON format. To obtain weather forecasts for a city, such as Beijing, send the following GET request:
Http://weather-china.appspot.com/api? City = Beijing
Parameter description:
City: city name. You can use Pinyin.
Returns a string in JSON format, encoded using a standard UTF-8, for example:
{
"Pub ",
"Wind ":{
"Chill": 33,
"Direction": 340,
"Speed": 14.48
},
"Astpolicmy ":{
"Sunrise": "4: 49 ",
"Sunset": "19: 46"
},
"Atmosphere ":{
"Humidity": 26,
"Visibility": 9.99,
"Pressure": 982.05,
"Rising": 0
},
"Forecasts ":[
{
"Date": "2010-07-05 ",
"Day": 1,
"Code": 32,
"Text": "clear ",
"Low": 23,
"High": 33,
"Image_large": "http://weather-china.appspot.com/static/w/img/d32.png ",
"Image_small": "http://weather-china.appspot.com/static/w/img/s32.png"
},
{
"Date": "2010-07-06 ",
"Day": 2,
"Code": 32,
"Text": "clear ",
"Low": 23,
"High": 34,
"Image_large": "http://weather-china.appspot.com/static/w/img/d32.png ",
"Image_small": "http://weather-china.appspot.com/static/w/img/s32.png"
}
]
}
Pub: current weather information release time;
WIND: Wind Power Information;
Astpolicmy: sunrise and sunset time;
Atmosphere: atmospheric information;
Forecasts: includes the weather forecast for the current day and the next day:
- Date: Date
- Day: Week
- Code: weather code (Please query the meaning of the code here)
- Text: Weather Information
- Low: Minimum Temperature
- High: maximum temperature
- Image_large: large image (250x180) Address
- Image_small: small image (61X34) Address
The weather information is not updated frequently and can be safely cached on the client for 1 hour.
Free for individuals or non-profit organizations.