Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Content-Type:text/plain");
- set_time_limit (0);
- $dir = dirname(__FILE__);
- $data = file_get_contents("$dir/full_html.htm");
- // regex find url
- preg_match_all('@https://fbcdn-sphotos-[a-z]+-a.akamaihd.net/hphotos-ak-[a-z0-9]+/t1.0-9/p417x417/[0-9]+_[0-9]+_[0-9]+_[a-z]+.jpg@si',$data,$url);
- $url = $url['0'];
- $i = 1;
- foreach ($url as $key => $vaule) {
- $vaule = str_replace("/p417x417/", "/", $vaule); // make it to link full resulotion
- download_img($vaule,$i);
- $i++;
- }
- function download_img($url,$num) { // download funcion
- $img = imagecreatefromjpeg($url);
- $path = "downloads/$num.jpg";
- imagejpeg($img, $path);
- echo "Downloaded $num \n";
- }
- die(); // get exit code 0
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement