Пример #1
0
 public function __construct($url)
 {
     if (!Crawler::is_there($url, '/page/1')) {
         $url = Crawler::cutuntillast($url, '/') . '/page/1';
     }
     $this->url = $url;
 }
Пример #2
0
                $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>
Пример #3
0
 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;
 }