What's new

Closed Mga master jan sa programming at website developer pasok.

Status
Not open for further replies.
php sir,

PHP:
$file_handle = fopen("urllist.txt", "r");
while (!feof($file_handle))
{
$url = trim(fgets($file_handle));
$content = file_get_contents($url);
$document = array($url,$content);
$serialized = serialize($document);
$fp = fopen('./documents/'.md5($url), 'w');
fwrite($fp, $serialized); fclose($fp);
}

fclose($file_handle);

yan lng po ang code ng crawler, eh open ng crawler lahat ng sites sa urllist.txt then sasave nya lahat ng content sa txt file. single thread at 1 level lng po yan, kilangan mong eh modify para maging multi threaded.
tyaka nga pala boss kunyari naka create na kami ng urllist ano yung magiging function nun ?
 
Status
Not open for further replies.
Back
Top