码迷,mamicode.com
首页 > 其他好文 > 详细

GetCheckProxy

时间:2017-09-28 09:50:39      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:str   lin   time   etl   cal   textarea   check   target   off   

@echo off
setlocal enabledelayedexpansion

set infile=free.txt
set url=https://www.google.com/?gws_rd=ssl
set pl="http://www.66ip.cn/mo.php?sxb=&tqsl=100&port=&export=&ktip=219&sxa=&submit=%%CC%%E1++%%C8%%A1&textarea="

echo --- %date% %time% available proxy lists --->>available.txt

wget %pl% -O down.txt
type down.txt|grep -Eio "[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,5}">%infile%
:: del down.txt 1>nul 2>nul

call :G_getrows %infile%
set /a checkline=1
for /f "delims=" %%i in (%infile%) do (
  call :checkProxy %%i !checkline!
  del temp.txt 1>nul 2>nul
  set /a checkline=!checkline!+1
)
echo --------------done----------------
pause >nul
exit /b

:checkProxy
set proxy=%1
wget -e https_proxy="%proxy%" -t 1 -T 1 %url% -O temp.txt 1>nul 2>nul
if %errorlevel% NEQ 0 echo %2/%lines%. %proxy% unavailable
if %errorlevel% EQU 0 (
  echo %2/%lines%. %proxy% available
  echo %proxy%>>available.txt
)
exit/b

:G_getrows 
set /a lines=0
for /f %%i in (‘findstr /n .* %1‘) do ( 
set /a lines=lines+1 
)
exit/b
GetCheckProxy.7z

GetCheckProxy

标签:str   lin   time   etl   cal   textarea   check   target   off   

原文地址:http://www.cnblogs.com/nlsoft/p/7604697.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!