NetBuilders

Members in Chat:

You are welcome to look around. You will have to register before you can post a message, create a blog, chat live with our members, or add a site to our directory.



Reply Learn SEO from Aaron Wall
Old 28 June, 2009, 17:16 PM   #1 (permalink)
Newbie Net Builder
 
xrvel's Avatar
 
Location: ProxyCoder.com
Blog Entries: 1
Thanked 19 Times in 8 Posts
Posts: 37
$NetBucks: 123
Join Date: Mar 2009
Last Online: 8 January, 2010 15:46 PM
Lightbulb Proxy Checker (for Proxy List)

Here is a code to check some proxies in your proxy list.
It checks dead or not, and the reciprocal status

Edit :
It can be used for all proxy listing script (devduke's or other's).
Because the input is only plain URL.
And the output is a basic array.

But it should be customized and modified further (which i can not write here, because it depends to each proxy list script) including :
- update the proxy status on the database.

PHP Code:
<?php
//
// Proxy list cleaner
//
// Author : Xrvel (xrvel.com)
//
// This cron script check each proxy and :
// - update its status (dead or alive).
// - check backlink
//
// Requirement :
// - PHP CURL
//
// Note that this function only check the URL.
// It does not mark it on database whether it is dead or not,
// So you must add your custom code yourself if you want
// it to automatically mark dead proxies on your database.
//

// Do not modify start
ob_start();
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s',time()-60).' GMT');
header('Cache-Control: private, no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0');
header('Pragma: no-cache');
//error_reporting(E_ALL);
ignore_user_abort(true);
set_time_limit(60 5);
session_start();
// Do not modify end

//
// Here is the proxy URL which you want to check
// You can customize it to receive URL from form / database
// Could be a string, or an array of string
//

/*
$proxy_url = array(
    'http://someonesproxy1.com',
    'http://someonesproxy2.com',
    'http://someonesproxy3.com'
);
*/

$proxy_url 'http://example.com';

//
// Reciprocal is marked as "found"
// if this string is found in the proxy's page
// But this script can not detect whether the reciprocal
// is on HTML comment / hidden section or such.
// You must manually check it (human editor)
//
$reciprocal_match 'yourdomain.com';

// Example :
$result check_the_proxy($proxy_url);
echo 
'<pre>'print_r($resulttrue), '</pre>';

//
// No need to modify anything below
//

//
// MAIN FUNCTION START
//
// Return type : array of mixed
//
function check_the_proxy($proxy_url) {
    global 
$reciprocal_match;

    
$proxies = array();// everything will be put here

    
if (is_string($proxy_url)) {
        
$proxy_url = array($proxy_url);
    }

    foreach (
$proxy_url as $u) {
        
$proxies[] = array(
            
'url' => $u,
            
'is_dead' => 0,
            
'http_code' => '',
            
'download_content_length' => '',
            
'reciprocal_found' => 0,
            
'curl_info' => array()
        );
    }
    unset(
$proxy_url);

    
$ch curl_init();
    
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    
curl_setopt($chCURLOPT_AUTOREFERERtrue);
    
curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    
curl_setopt($chCURLOPT_MAXREDIRS2);
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6');
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERfalse);
    
curl_setopt($chCURLOPT_TIMEOUT30);

    
$i 0;

    
// loop for each proxy
    
foreach ($proxies as $data) {
        
curl_setopt($chCURLOPT_URL$data['url']);
        
curl_setopt($chCURLOPT_REFERER$data['url']);
        
$res curl_exec($ch);
        
$info curl_getinfo($ch);

        
$proxies[$i]['curl_info'] = $info;
        
$proxies[$i]['http_code'] = $info['http_code'];
        
$proxies[$i]['download_content_length'] = $info['download_content_length'];

        
// Check is dead ?
        
if ($info['http_code'] == '200' || $info['http_code'] == '300' || $info['http_code'] == '301') {
            
$proxies[$i]['is_dead'] = 0;
        } else {
            
$proxies[$i]['is_dead'] = 1;
        }

        
// Check reciprocal
        
if (stristr($res$reciprocal_match)) {
            
$proxies[$i]['reciprocal_found'] = 1;
        } else {
            
$proxies[$i]['reciprocal_found'] = 0;
        }
        
$i++;
    }    
    
curl_close($ch);
    unset(
$ch$res);

    return 
$proxies;
}
// MAIN FUNCTION END
?>
Output example :
Code:
Array
(
    [0] => Array
        (
            [url] => http://example.com
            [is_dead] => 0
            [http_code] => 200
            [download_content_length] => 438
            [reciprocal_found] => 0
            [curl_info] => Array
                (
                    [url] => http://example.com
                    [content_type] => text/html; charset=UTF-8
                    [http_code] => 200
                    [header_size] => 276
                    [request_size] => 183
                    [filetime] => -1
                    [ssl_verify_result] => 0
                    [redirect_count] => 0
                    [total_time] => 7.071
                    [namelookup_time] => 6.339
                    [connect_time] => 6.475
                    [pretransfer_time] => 6.476
                    [size_upload] => 0
                    [size_download] => 438
                    [speed_download] => 61
                    [speed_upload] => 0
                    [download_content_length] => 438
                    [upload_content_length] => 0
                    [starttransfer_time] => 7.071
                    [redirect_time] => 0
                )

        )

)
__________________
. Xrvel . Free Proxy List Script (BETA) .
Anyone want to join open source proxy list project? Let's work with subversion. PM me for details.
Domains for sale : ihidden.com

Last edited by xrvel; 28 June, 2009 at 17:48 PM..
  Reply With Quote
Old 28 June, 2009, 17:40 PM   #2 (permalink)
Master Net Builder
 
Aquarezz's Avatar
 
Location: Belgium
Blog Entries: 4
Thanked 524 Times in 409 Posts
Posts: 3,525
$NetBucks: 1,043
Join Date: Dec 2008
Last Online: Yesterday 19:39 PM
Send a message via MSN to Aquarezz Send a message via Yahoo to Aquarezz
Default

For which script is this? The proxyeater script? Or ProxyListscript? Or ??
  Reply With Quote
Old 28 June, 2009, 17:46 PM   #3 (permalink)
Newbie Net Builder
 
xrvel's Avatar
 
Location: ProxyCoder.com
Blog Entries: 1
Thanked 19 Times in 8 Posts
Posts: 37
$NetBucks: 123
Join Date: Mar 2009
Last Online: 8 January, 2010 15:46 PM
Default

Quote:
Originally Posted by Aquarezz View Post
For which script is this? The proxyeater script? Or ProxyListscript? Or ??
It can be used for all proxy listing script (devduke's or other's).
Because the input is only plain URL.
And the output is a basic array.

But it should be customized further, according to each proxy list script, including :
- update the proxy status on the database.
__________________
. Xrvel . Free Proxy List Script (BETA) .
Anyone want to join open source proxy list project? Let's work with subversion. PM me for details.
Domains for sale : ihidden.com
  Reply With Quote
Reply

Bookmarks

Tags
checker, list, php, proxy

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
proxy Topsite and proxy List ? jakki Web Proxies 2 1 September, 2009 08:02 AM
Submit Your "Proxy Site, List, Proxy Forum, Directory, Proxy Blogs" FREE! Jorge05r Proxy List Announcements 11 6 July, 2009 19:08 PM
Submit your Proxy to A new Proxy List SpeedyProxy.info Proxy List Announcements 15 13 June, 2009 08:00 AM
[Free] Free Proxy List & Fresh Proxy Sites! Captain Tycoon Services 1 6 April, 2009 22:43 PM
Global Proxies.net - Proxy Directory - List Your Proxy Now - Over 4200 Proxies Listed thatsfine Web Proxies 0 17 January, 2009 00:40 AM


All times are GMT. The time now is 08:36 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios