php set_time_limit include parser php include notebook php while 500 p

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
set_time_limit(0);
include('parser.php');
include('notebook.php');
$i = 0;
while ($i < 500) {
$parser = new Curl;
$page = $parser->get('http://hotline.ua/computer/noutbuki-netbuki/?sort=4&p=' . $i);
preg_match_all('/<h3><a .+\}\);\">(.+)<\/a>/', $page, $name_matches);
preg_match_all('/\'tech\-char\'>(.+)<\/span>/', $page, $prop_matches);
$string = '';
for ($a = 0; $a <= 24; $a++) {
$notebook = new Notebook;
$notebook->parse_from_html($prop_matches[1][$a]);
$string .= $i+1 . '. '; //number of item
$string .= $name_matches[1][$a] . '<br/>' . $notebook->get_html_result() . '<br/>';
$i++;
unset($notebook);
}
file_put_contents('popular_notebooks.html', $string, FILE_APPEND);
unset($parser);
}