View Single Post
Old 05-04-2009, 11:11 PM  
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
Quote:
Originally Posted by ProG View Post
You can use the sleep() function.

PHP Code:
<?php
    $search 
"google"// Your seach string
    
$pass "";
    
$fail "";
    
    if ( ( 
$websites file"websites.txt" ) ) !== false )
    {
        foreach( 
$websites as $url )
        {
            
$url trim$url );
            
$contents file_get_contents$url );
            if ( ( 
strpos$contents$search ) ) !== false )
            {
                
$pass .= "{$url}\n";
            }
            else
            {
                
$fail .= "{$url}\n";
            }
            
sleep10 ); // 10 second timeout between URLs
        
}
    }
    
    if ( ( 
$handle fopen"valid.txt"'at' ) ) !== false )
    {
        
fwrite$handle$pass );
        
fclose$handle );
    }
    
    if ( ( 
$handle fopen"bad.txt"'at' ) ) !== false )
    {
        
fwrite$handle$fail );
        
fclose$handle );
    }
?>
hrmm they don't add to txt every 10 seconds, like script loads, and after like 2-3 minutes do I get results in .txt ... does the script output results after it went through all of them? it doesn't add live ? just wondering
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote