针对中国地区的天气预报服务,包括: 查询天气预报的Web站点:http://weather-china.appspot.com/ 基于JSON的REST API接口
2010-07-06 08:09
1151 查看
优点:数据与样式分离
weather-china封装Yahoo提供的Weather RSS Feed,提供JSON格式的REST API接口,要获取某个城市的天气预报,例如北京,发送如下GET请求:
http://weather-china.appspot.com/api?city=beijing
参数说明:
city:城市名称,可以使用拼音。
返回JSON格式的字符串,使用标准的UTF-8编码,例如:
pub:当前天气信息发布时间;
wind:风力信息;
astronomy:日出和日落时间;
atmosphere:大气信息;
forecasts:包含当天和第二天的天气预报:
date:日期
day:星期
code:天气代码(请在此查询代码含义)
text:天气信息
low:最低温度
high:最高温度
image_large:大图片(250x180)地址
image_small:小图片(61x34)地址
天气信息不会频繁更新,可以安全地在客户端缓存1小时。
免费供个人或非营利性组织使用。
缺点:尚不完善,不支持自动检索城市
Google code: http://code.google.com/p/weather-china/weather-china封装Yahoo提供的Weather RSS Feed,提供JSON格式的REST API接口,要获取某个城市的天气预报,例如北京,发送如下GET请求:
http://weather-china.appspot.com/api?city=beijing
参数说明:
city:城市名称,可以使用拼音。
返回JSON格式的字符串,使用标准的UTF-8编码,例如:
{ "pub" : "2010-07-05 09:00", "wind" : { "chill" : 33, "direction" : 340, "speed" : 14.48 }, "astronomy" : { "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" : "晴", "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" : "晴", "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:当前天气信息发布时间;
wind:风力信息;
astronomy:日出和日落时间;
atmosphere:大气信息;
forecasts:包含当天和第二天的天气预报:
date:日期
day:星期
code:天气代码(请在此查询代码含义)
text:天气信息
low:最低温度
high:最高温度
image_large:大图片(250x180)地址
image_small:小图片(61x34)地址
天气信息不会频繁更新,可以安全地在客户端缓存1小时。
免费供个人或非营利性组织使用。
相关文章推荐
- 针对中国地区的天气预报服务,包括: 查询天气预报的Web站点:http://weather-china.appspot.com/ 基于JSON的REST API接口
- 基于mirrorrr搭建的自己的在线代理(http://zfqproxy.appspot.com/)
- 关于中国天气(Weather.com.cn)的查询
- Centos 5.3安装Apache +Sendmail+Openwebmail实用配置http://chinaapp.sinaapp.com/thread-1183-1-1.html
- 使用 Spring 3 MVC HttpMessageConverter 功能构建 RESTful web 服务(包括使用 RestTemplate 与 REST 服务进行通信)
- http://www.webservicex.net/globalweather.asmx 天气服务返回值介绍
- 天气接口 http://flash.weather.com.cn/wmaps/xml/china.xml
- 基于 REST 的 Web 服务:基础
- JSON 入门指南 http://www.ibm.com/developerworks/cn/web/wa-lo-json/
- Android解析中国天气接口JSon数据,应用于天气查询!
- REST = HTTP动词(GET POST PUT DELETE)操作 + 服务器暴露资源URI,最后返回状态码(充分利用HTTP自身的特征,而不仅仅是把HTTP当作传输协议。Rest协议是面向资源的,SOAP是面向服务的),表现形式可以是JSON XML BIN,举例很清楚
- 构建了基于SAE的wordpress: http://johnhome.sinaapp.com
- Springboot 实现 Restful 服务,基于 HTTP / JSON 传输
- 基于 REST 的 Web 服务:基础
- WebService调用http://www.webxml.com.cn中的一些服务示例
- window phone7.1 天气预报教程(二)WebClient获取天气和json数据解析显示
- 使用Google Weather API查询天气预报
- 使用Google Weather API查询天气预报
- Spring boot构建基于rest的Web服务
- failed to load java type corresponding to e=web-app@http://java.sun.com/xml/ns/javaee