- @echo off
- set "myCity=beijing"
- set "fileUTF8=%temp%\AQI.UTF8"
- set "fileTMP=%temp%\AQI.TMP"
- set "fileANSI=%temp%\AQI.ANSI"
- wget -q "http://www.pm25x.com/city/%myCity%.htm" -O "%fileUTF8%"
- sed -r "/rt-title/!d; s#.*<b>(.*)</b>(.*)</div>#\1 \2#" "%fileUTF8%" > "%fileTMP%"
- sed -r "/aqivalue/!d; s#.*>(.*)</div>#[PM2.5] \1#" "%fileUTF8%" >> "%fileTMP%"
- sed -r "/aqileveltext/!d; s#.*>(.*)</div>#\1#" "%fileUTF8%" >> "%fileTMP%"
- sed "/utip/!d; s#.*utip..##; s#</div>##" "%fileUTF8%" >> "%fileTMP%"
- powershell -c "Get-Content '%fileTMP%' -Encoding utf8 | Out-File -Encoding default '%fileANSI%'"
- type "%fileANSI%"
- pause
复制代码 wget.exe sed.exe 下载地址:
http://bbs.bathome.net/s/tool/index.html |