public function __construct($url) { if (!Crawler::is_there($url, '/page/1')) { $url = Crawler::cutuntillast($url, '/') . '/page/1'; } $this->url = $url; }
$berhasil = true; $key = $filename; $results[$filename] = $img_url; ?> <a href="<?php echo $val; ?> "><?php echo $key; ?> </a><br /> <?php flush(); } else { } } } } if (isset($start_urlx)) { if (strlen($cfrom) && strlen($cto)) { $start_urlx = Crawler::cutuntillast($start_urlx, '/'); for ($i = $cfrom; $i <= $cto; ++$i) { crawl_1_page($start_urlx . '/' . $i); } } else { crawl_1_page($start_urlx); } } ?> </body> </html>
public static function parse_url($url, $component = -1) { $hasil = parse_url($url, $component); $hasil['filename'] = basename($hasil['path']); $hasil['extension'] = Crawler::cutfromlast($hasil['filename'], '.'); $hasil['filename_noext'] = Crawler::cutuntillast($hasil['filename'], '.'); return $hasil; }