tq.bat
用法:tq [城市]
城市参数缺省时默认为IP定位城市。- @echo off
- setlocal enabledelayedexpansion
- if exist "D:\Path" (set _path_fl_=D:\Path) else (set _path_fl_=C:\Path)
- call %_path_fl_%\path.bat
- set "f=%*"
- if not defined f (
- for /f "delims=" %%i in ('call city') do set ct=%%i
- ) else (
- set ct=%1
- )
-
- echo !ct!的天气:
- for /f "delims=" %%i in ('call eurl !ct!') do set ct=%%i
- rem set ct=!ct:%%=%%%%!
- echo=>%tmp%\_tq_more_tmp_.txt
- for /f "delims=" %%i in ('call cjson "对不起,您没有权限发表 URL 连接,请返回修改。?city=!ct!"') do (
- set i=%%i
- set i=!i:{= !
- set i=!i:}= !
- set i=!i:[= !
- set i=!i:]= !
- set i=!i:"message": "Success ",= !
- set i=!i:"status": 200,= !
- set i=!i:"city"=城市!
- set i=!i:"count"=编号!
- set i=!i:"data"=现在天气!
- set i=!i:"shidu"=空气湿度!
- set i=!i:"pm25"=空气PM2.5!
- set i=!i:"pm10"=空气PM1.0!
- set i=!i:"quality"=空气质量!
- set i=!i:"wendu"=温度!
- set i=!i:"ganmao"=户外活动!
- set i=!i:"yesterday"=明天天气!
- set i=!i:"forecast"=七天天气!
- set i=!i:"date"=日期!
- set i=!i:"sunrise"=日出!
- set i=!i:"high"=最高温度!
- set i=!i:"low"=最低温度!
- set i=!i:"sunset"=日落!
- set i=!i:"aqi"=空气质量指数!
- set i=!i:"fx"=风向!
- set i=!i:"fl"=风级!
- set i=!i:"type"=天气状况!
- set i=!i:"notice"=提醒!
- set i=!i:,= !
- set i=!i:"= !
- echo=!i! >>%tmp%\_tq_more_tmp_.txt
- )
- more /s %tmp%\_tq_more_tmp_.txt
- del /F /Q %tmp%\_tq_more_tmp_.txt 2>nul
- endlocal
复制代码
|