免费天气接口:http://mobile.weather.com.cn/data/sk/城市ID.html
例如: http://mobile.weather.com.cn/data/sk/101240701.html
返回数据:{"sk_info":{"date":"20131012","cityName":"赣州","areaID":"101240701","temp":"32℃","tempF":"89.6℉","wd":"东北风","ws":"3级","sd":"27%","time":"15:10","sm":"暂无实况"}}
城市编码:点我下载
代码:
@Test
public void testetWeatherInfo(){
//南昌天气预报信息
String u="http://mobile.weather.com.cn/data/sk/101240101.html";
String info=WeatherUtil.getWeatherInfo(u);
//输出
System.out.println("info:"+info);
}
/**
* @author hh
*/
public class WeatherUtil {
/**
* 获取天气信息
*