🔒 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.

About this Thread

  • 23
    Replies
  • 1K
    Views
  • 7
    Participants
Last reply from:
rabb1t

Trending Topics

Online now

Members online
1,036
Guests online
946
Total visitors
1,982

Forum statistics

Threads
2,274,923
Posts
28,959,366
Members
1,233,485
Latest member
senpaikatzu_88
Back
Top