![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-11-11 08:30 |
47,815 topics / 349,930 posts / today 0 new / 48,291 members |
| DOS批处理 & 脚本技术(批处理室) » [Original] Simple detection of whether a proxy server is available using wget |
| Printable Version 6,298 / 29 |
| Floor16 lxmxn | Posted 2006-11-28 05:58 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Re: NaturalJ0 Thanks for your suggestion, brother. After thinking about it, I found that there is a -S parameter in wget that can count the detailed download information, including the connection speed. The speed is indirectly obtained through the front and back two times. If you want to sort, you must analyze the information obtained from the -S parameter, which will be relatively troublesome. Moreover, in the code at the top of the post, the time for wget to time out to obtain the web page is set to 3 seconds, so the detected speed should be acceptable. If you want a faster proxy connection speed, you can modify the value of the -T parameter. Re: ccwan Thanks for your encouragement, brother. |
|
| Floor17 wang6610 | Posted 2006-11-28 06:51 |
| 银牌会员 Posts 488 Credits 1,246 | |
|
Will it continue to check pages 2, 3...?
|
|
| Floor18 lxmxn | Posted 2006-11-28 11:39 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Re: wang6610 It can only detect the specified industry web proxy list. If you want to detect the proxy lists of other pages, you can manually add URLs to the batch processing. I will also try to improve it as much as possible. |
|
| Floor19 yunlin | Posted 2006-11-28 13:10 |
| 新手上路 Posts 7 Credits 5 | |
| Floor20 bigcarp | Posted 2007-01-08 23:39 |
| 初级用户 Posts 6 Credits 21 | |
| Floor21 lixinwu | Posted 2007-01-25 17:00 |
| 初级用户 Posts 14 Credits 31 | |
|
It's really good, but it's a pity that it can only verify the proxy of that one website. It doesn't work when changing to another one. All the proxies of that website have become invalid. It's best to find a verification that can be updated every day. Or make the code more intelligent, so that it can deal with most proxy sites.
|
|
| Floor22 lixinwu | Posted 2007-01-25 17:55 |
| 初级用户 Posts 14 Credits 31 | |
|
Can the expert help extract and verify the proxies from this website? http://proxy.chedan.org/
|
|
| Floor23 vkill | Posted 2007-01-26 02:01 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
Originally posted by lixinwu at 2007-1-25 17:55: I wonder if p-proxy can help you |
|
| Floor24 lixinwu | Posted 2007-01-26 03:03 |
| 初级用户 Posts 14 Credits 31 | |
|
Okay, please let the p-proxy expert come and help!
|
|
| Floor25 lixinwu | Posted 2007-01-26 04:23 |
| 初级用户 Posts 14 Credits 31 | |
|
Oh, it turns out it's a program... I used it, but unfortunately it doesn't support the code of this website
|
|
| Floor26 lixinwu | Posted 2007-01-26 04:24 |
| 初级用户 Posts 14 Credits 31 | |
|
Modifying based on the owner's code should allow extraction. The owner's code is also much more concise and has a much smaller size...
|
|
| Floor27 honghunter | Posted 2007-12-04 07:16 |
| 中级用户 Posts 135 Credits 321 | |
|
I'm sorry, I'm replying to an old post.
Mainly I haven't understood the following sentences clearly all the time, and I hope some expert can explain them to me: 1 set set= 2 set set=%%a 3 set "set=!set:‍=!" 4 set "set=!set!:%%b" Main questions: 1, Will there be no problem if the system's keyword is used as the environment variable name? 2, Why is it necessary to set it to empty once before each setting? Can the first sentence be omitted? 3, Looking at the original content of the web page: <tr><td>202.105.182.20‍:80</td><td>HTTP</td><td>328,813,813</td><td>Zhuhai City, Guangdong Province</td></tr> I don't quite understand the algorithm for intercepting the proxy address. |
|
| Floor28 honghunter | Posted 2007-12-04 07:59 |
| 中级用户 Posts 135 Credits 321 | |
|
There is also a question, that is, when the data in the source code becomes the following form, how to take into account the two methods?
<tr><td>211.142.213.11‌‍:80</td><td>HTTP</td><td>110,7203,7203</td><td>Hunan Province, Changsha City, Mobile</td></tr> |
|
| Floor29 honghunter | Posted 2007-12-04 08:04 |
| 中级用户 Posts 135 Credits 321 | |
|
```
REM $Id: get.proxy.bat 80 2007-12-04 08:21:12Z honghunter $ REM Original author: lxmxn REM From: http://www.cn-dos.net/forum/viewthread.php?tid=25126&fpage=0&highlight=&page=1 REM IF "%ORG_PATH%"=="" CALL D:\dev\dps4e\check_proxy\env_setting.bat @ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION&title Proxy Detection IF "%1"=="sub1" GOTO sub1 :main IF EXIST useproxy.txt DEL /a/q useproxy.txt FOR /L %%A IN (1,1,10) DO CALL %0 sub1 %%A START useproxy.txt GOTO :eof :sub1 SHIFT /1 ECHO;>>useproxy.txt ECHO Detected available proxies for http://www.cnproxy.com/proxy%1.html on %date% %time%: >>useproxy.txt ECHO;>>useproxy.txt ECHO ############################################################# >>useproxy.txt IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul wget http://www.cnproxy.com/proxy%1.html >nul 2>nul :html_down_ok title Checking proxy%1, please wait.... FOR /f "tokens=1,2 delims=^<trd>: " %%a IN ('type proxy%1.html ^| findstr /c:"HTTP" ') DO ( set set= set set=%%a SET "tempset=!set:‌‍=!" IF "!tempset!"=="!set!" SET "tempset=!set:‍=!" set "set=!tempset!:%%b" ECHO Checking proxy !set!, please wait.... wget -q -T 3 -t 1 -e "http_proxy=!set!" http://www.dps4e.com -O - >nul 2>nul && echo Detected ******* !set! ******* proxy available&&echo ----!set! >>useproxy.txt ) IF EXIST proxy%1.html DEL proxy%1.html /a/s >nul GOTO :eof [ Last edited by honghunter on 2007-12-4 at 04:40 PM ] ``` |
|
| Floor30 jethroso | Posted 2008-11-20 12:20 |
| 新手上路 Posts 4 Credits 4 | |
|
Just tried it and it didn't work? Why are there all ###### signs?
?[ Last edited by jethroso on 2008-11-20 at 12:24 ] |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |