View Single Post
Old 05-04-2009, 11:20 PM  
ProG
Confirmed User
 
Join Date: Apr 2009
Posts: 1,319
Sorry that code has a problem in Windows, this should do the trick.

PHP Code:
<?php
    $search 
"google"// Your seach string
    
    
if ( ( $websites file"websites.txt" ) ) !== false )
    {
        foreach( 
$websites as $url )
        {
            
$url trim$url );
            
$contents file_get_contents$url );
            if ( ( 
strpos$contents$search ) ) !== false )
            {
                if ( ( 
$handle fopen"valid.txt"'at' ) ) !== false )
                {
                    
$write "{$url}\n";
                    
fwrite$handle$write );
                    
fclose$handle );
                }
            }
            else
            {
                if ( ( 
$handle fopen"bad.txt"'at' ) ) !== false )
                {
                    
$write "{$url}\n";
                    
fwrite$handle$write );
                    
fclose$handle );
                }
            }
            
sleep10 ); // 10 second timeout between URLs
        
}
    }
?>
ProG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote