Jump to content
Sign in to follow this  
zeffy

CheckProxyList UDF

Recommended Posts

zeffy

This is a UDF version of the proxy checker that I posted a couple days ago. I eliminated the need for a temporary dump of all the proxies, and it no longer needs String.au3, and added the ability to update a progress bar as it gets done, and lowered the ping timeout to 450, so it only takes about 8 minutes to check a 1000 line list instead of 16 lol. and thanks to IchBistTod for the math for the progress bar and fixing the $aSplit array and other misc error checking :)

#include-once
#include <IE.au3>
#include <ProgressConstants.au3>

; #FUNCTION# ====================================================================================================================
; Name...........: _CheckProxyList
; Description ...: Checks an online list of proxies
; Syntax.........: _CheckProxyList($sUrl[, $iTimeout = 450[, $iOffset = 1[, $sDelimeter = @CRLF[, $hProgress = 0]]])
; Parameters ....: $sUrl         - URL of the online proxy list
;                  $iOffset      - Line of the list to start at
;                  $sDelimeter   - Character to separate the valid proxies with
;                  $hProgress    - The handle of the progress bar you want to update
; Return values .: Success       - Returns the string with a list of the working proxies
;                  Failure       - Returns 0
; Author ........: zeffy
; Thanks ........; IchBistTod for math and error checking :)
; ===============================================================================================================================

Func _CheckProxyList($sUrl, $iTimeout = 450, $iOffset = 1, $sDelimeter = @CRLF, $hProgress = 0)

    $oIE = _IECreate($sUrl, 0, 0)
    If Not @error Then
        $sText = _IEBodyReadText($oIE)
        $aSplit = StringSplit(StringReplace($sText, @CR, ""), @LF)
        If $hProgress Then
            GUICtrlSetLimit($hProgress, 0, $aSplit[0])
        EndIf
        Local $sList
        For $iOffset To $aSplit[0]
            $sProxy = StringSplit($aSplit[$iOffset], ":")
            Ping($sProxy[1], $iTimeout)
            If Not @error Then
                $sList &= $aSplit[$iOffset] & $sDelimeter
            EndIf
            If $hProgress Then
                GUICtrlSetData($hProgress, Round((($iOffset / $aSplit[0]) * 100)))
            EndIf
        Next
        GUICtrlSetData($hProgress, 100)
        Return $sList
    EndIf
EndFunc   ;==>_CheckProxyList

Example:

#include "CheckProxyList.au3"
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>

$Form1 = GUICreate("Form1", 275, 27, 192, 124)
$Progress1 = GUICtrlCreateProgress(1, 1, 273, 25)
GUISetState(@SW_SHOW)
$proxies = _CheckProxyList("http://www.textproxylists.com/proxy.php?allproxy", 450, 9, @CRLF, $Progress1)
FileWrite("proxylist.txt", $proxies)

Enjoy, and please post feedback :idea:

NEW VERSION

CheckProxyList.au3

* added iTimeout option, to set custom ping timeout

CheckProxyList.au3

Edited by Zef

Share this post


Link to post
Share on other sites
zeffy

added some stuff (see first post)

Edited by Zef

Share this post


Link to post
Share on other sites
kpuk

If ICMP protocol disabled on proxy server script show that proxy offline. I use HttpSetProxy+InetGet but it's not so fast as i want(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×