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 );
}
}
sleep( 10 ); // 10 second timeout between URLs
}
}
?>