hutool http+天氣預報

中國天氣接口:http://www.weather.com.cn/data/sk/地址.html,只顯示當天。html

sojson接口:http://t.weather.sojson.com/api/weather/city/地址,顯示當天和將來4天。json

 

//String result = HttpUtil.get("http://www.weather.com.cn/data/sk/101110101.html");
String result = HttpUtil.get("http://t.weather.sojson.com/api/weather/city/101090601"); Console.log(result);

 

輸出:api

{ "time": "2019-01-18 09:00:41", "cityInfo": { "city": "廊坊市", "cityId": "101090601", "parent": "河北", "updateTime": "08:53" }, "date": "20190118", "message": "Success !", "status": 200, "data": { "shidu": "36%", "pm25": 137, "pm10": 214, "quality": "中度污染", "wendu": "-5", "ganmao": "兒童、老年人及心臟、呼吸系統疾病患者人羣應減小長時間或高強度戶外鍛鍊,通常人羣適量減小戶外運動", "yesterday": { "date": "17", "sunrise": "07:32", "high": "高溫 5.0℃", "low": "低溫 -9.0℃", "sunset": "17:14", "aqi": 67, "ymd": "2019-01-17", "week": "星期四", "fx": "西北風", "fl": "<3級", "type": "晴", "notice": "願你擁有比陽光明媚的心情" }, "forecast": [ { "date": "18", "sunrise": "07:32", "high": "高溫 6.0℃", "low": "低溫 -6.0℃", "sunset": "17:15", "aqi": 193, "ymd": "2019-01-18", "week": "星期五", "fx": "西南風", "fl": "<3級", "type": "多雲", "notice": "陰晴之間,謹防紫外線侵擾" }, { "date": "19", "sunrise": "07:31", "high": "高溫 4.0℃", "low": "低溫 -6.0℃", "sunset": "17:17", "aqi": 88, "ymd": "2019-01-19", "week": "星期六", "fx": "東北風", "fl": "<3級", "type": "多雲", "notice": "陰晴之間,謹防紫外線侵擾" }, { "date": "20", "sunrise": "07:31", "high": "高溫 4.0℃", "low": "低溫 -8.0℃", "sunset": "17:18", "aqi": 41, "ymd": "2019-01-20", "week": "星期日", "fx": "西北風", "fl": "3-4級", "type": "晴", "notice": "願你擁有比陽光明媚的心情" }, { "date": "21", "sunrise": "07:30", "high": "高溫 7.0℃", "low": "低溫 -5.0℃", "sunset": "17:19", "aqi": 71, "ymd": "2019-01-21", "week": "星期一", "fx": "西南風", "fl": "<3級", "type": "晴", "notice": "願你擁有比陽光明媚的心情" }, { "date": "22", "sunrise": "07:30", "high": "高溫 9.0℃", "low": "低溫 -6.0℃", "sunset": "17:20", "aqi": 35, "ymd": "2019-01-22", "week": "星期二", "fx": "西北風", "fl": "<3級", "type": "晴", "notice": "願你擁有比陽光明媚的心情" } ] } }

 

 

//北京
101010100 北京 101010200 海淀 101010300 朝陽 101010400 順義 101010500 懷柔 101010600 通州 101010700 昌平 101010800 延慶 101010900 豐臺 101011000 石景山 101011100 大興 101011200 房山 101011300 密雲 101011400 門頭溝 101011500 平谷 101011600 八達嶺 101011700 佛爺頂 101011800 湯河口 101011900 密雲上甸子 101012000 齋堂 101012100 霞雲嶺 //天津
101030100 天津 101030200 武清 101030300 寶坻 101030400 東麗 101030500 西青 101030600 北辰 101030700 寧河 101030800 漢沽 101030900 靜海 101031000 津南 101031100 塘沽 101031200 大港 101031300 平臺 101031400 薊縣 //河北廊坊
101090601 廊坊 101090602 固安 101090603 永清 101090604 香河 101090605 大城 101090606 文安 101090607 大廠 101090608 霸州 101090609    三河

 

下載全國地址:https://files.cnblogs.com/files/yaoyuan2/%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5%E5%9C%B0%E5%9D%80.7zspa

相關文章
相關標籤/搜索