@echo offset "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
Batch Query PM2.5 real-time Air quality index (AQI)
Http://bbs.bathome.net/thread-38817-1-1.html
This article is from the "Batcher" blog, make sure to keep this source http://batcher.blog.51cto.com/11779161/1794373
Windows Batch Bat script query PM2.5 real-time Air quality index (AQI)