Quote:
Originally Posted by ProG
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";
}
sleep( 10 ); // 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
