title: Fastest method to get the screenshot image of an external webpage
body: <p>Hi,</p>
  
  <p>I want to get the screenshot of several pages and display them on my website. As of now, I am using the method below:</p>
  
  <pre><code>&lt;?php
  
  $site = $screenurl;
  
  $image = file_get_contents("https://www.googleapis.com/pagespeedonline/v1/runPagespeed?url=$site&amp;screenshot=true");
  $image = json_decode($image, true); 
  $image = $image['screenshot']['data'];
  $image = str_replace(array('_','-'),array('/','+'),$image); 
  
  echo "&lt;img src=\"data:image/jpeg;base64,".$image."\" alt=\"\"&gt;";
  ?&gt;
  </code></pre>
  
  <p>but with 10 or more images per page, this method takes FOREVER to load them all or it wont even load them at all because it times out. I would like to know a more effective, optimized and faster way to do this.</p>
  
  <p>Thank you.</p>