- @echo off&&setlocal enabledelayedexpansion
- del /q *a1.*
- set qx=20221017
- wget --user-agent="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3" --no-check-certificate -c -q -N -t 0 -O a1.html "http://www.weather.com.cn/#404"
- findstr /i "utf" a1.html&&iconv -c -f utf-8 -t GBK a1.html>>gba1.html
- findstr /i "padding" gba1.html|findstr /i "%date:~0,4%">a1.txt
- cls
- for /f "tokens=1,2* delims=^< " %%i in (a1.txt) do (
- set "sj=%%i"
- set sj=!sj: =!
- set sj=!sj:年=!
- set sj=!sj:月=!
- set sj=!sj:日=!
- )
- del /q *a1.*>nul 2>nul
- if !rq! leq %qx% (goto bq) else (echo 程序使用到期,不再运行&&ping /n 5 127.1>nul&&exit)
-
- :bq
- echo 欢迎使用
- pause
复制代码 采用天气网的网页数据,因为要转码,又多采用了iconv程序http://bcn.bathome.net/s/tool/index.html?key=iconv |