hello, i need help to scrape the image of the movies from http://www.yaske.to/es/pelicula/0003735/ver-you-39-re-next-online.html

i have this but not works fine:

$jm_anime_imagen = cut_str($pagina, '<meta property="og:image" content="', '" />'); $imagen = str_replace("http://yaske.to/upload/images/", "", $jm_anime_imagen); copy($jm_anime_imagen, 'imagen/'.$imagen);
echo '<img src="http://www.masfriv.com/imagen/'.$imagen.'" width="148" heigth="220" />';

any can help please

This is the same request of your previous thread but with a different schema to match:

Probably you can apply my suggestion by changing the pattern in preg_match(). Also we still don't know the code of cut_str(), please refer to my question in the previous thread. If we don't know how it works a user defined function, we cannot help you to fix it.

Hello, i have the image link in $jm_anime_imagen, but how to save this image in one folder of my site?

$jm_anime_imagen = cut_str($pagina, '<meta property="og:image" content="', '" />');
echo $jm_anime_imagen;

thanks.

i have this function for save the image, but i need save the image with the content of $jm_anime_titulo.

function cache_image($jm_anime_imagen){
    //replace with your cache directory
    $image_path = 'imagen/';
    //get the name of the file
    $exploded_image_url = explode("/",$jm_anime_imagen);
    $image_filename = end($exploded_image_url);
    $exploded_image_filename = explode(".",$image_filename);
    $extension = end($exploded_image_filename);
    //make sure its an image
    if($extension=="gif"||$extension=="jpg"||$extension=="png"){
    //get the remote image
    $image_to_fetch = file_get_contents($jm_anime_imagen);
    //save it
    $local_image_file = fopen($image_path.$image_filename, 'w+');
    chmod($image_path.$image_filename,0755);
    fwrite($local_image_file, $image_to_fetch);
    fclose($local_image_file);
    }
    }


    cache_image($jm_anime_imagen);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.