(.*)|', $page, $matches, PREG_SET_ORDER); foreach($matches AS $image) { $photos[] = array($image[1], $image[2]); } } function get_photo_count($page) { preg_match('/
\((\d+) photos\)<\/div>/', $page, $match); return $match[1]; } function get_page_count($page) { preg_match_all('|(\d+)|', $page, $matches); if(count($matches[1]) > 0) { return array_pop($matches[1]); } return 1; } $target = $_GET['url']; if($target != '') { echo "

$target

"; $content = file_get_contents($target); $count = get_photo_count($content); $pages = get_page_count($content); echo "$count photos on $pages pages
"; echo "Loading, please wait.

"; flush(); ob_flush(); get_photos($content); for($i = 2; $i < $pages + 1; $i++) { $url = $target.'page'.$i; $content = file_get_contents($url); get_photos($content); } foreach($photos AS $photo) { $normal = preg_replace('/((_.)?\.jpg)/', '.jpg', $photo[0]); $small = preg_replace('/((_.)?\.jpg)/', '_s.jpg', $photo[0]); $big = preg_replace('/((_.)?\.jpg)/', '_b.jpg', $photo[0]); echo ""; echo "Normal size"; } } ?>