Hi guys,

Hope someone can point me in the right direction here!

I'm calling a few external html files from other sites in my network to my main site, showing the latest photos from the photo site, video from the video site etc. I'm doing this with a curl function and then I'm caching that with the following code:

PHP Code:
// get external data
function getData($url)
$ch curl_init();
$timeout 5;
$data curl_exec($ch);

// cache code
$break Explode('/'$url);
$file $break[count($break) - 1];
$cachefile substr_replace($file ,"",-4).'.htm';
$cachetime 18000;

// serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && time() - $cachetime filemtime($cachefile)) {
"<!-- Cached copy, generated ".date('H:i'filemtime($cachefile))." -->\n";
ob_start(); // start the output buffer
              <?php $latestPhotos getData('http://externalsite.com/latest-gallery-list'); echo $latestPhotos?>

// cache the contents to a file
$cached fopen($cachefile'w');
ob_end_flush(); // Send the output to the browser
That gives me a static html that looks something like this:

HTML Code:
<li><a href="http://www.externalsite.com/gallery-link-1" target="_blank">
<img src="http://www.externalsite.com/gallerythumbnail-1.jpg">

<li><a href="http://www.externalsite.com/gallery-link-2" target="_blank">
<img src="http://www.externalsite.com/gallerythumbnail-2.jpg">

<li><a href="http://www.externalsite.com/gallery-link-3" target="_blank">
<img src="http://www.externalsite.com/gallerythumbnail-3.jpg">
Is it possible to modify this in someway so that the thumbnails get saved locally? Or some other better way to to this all around?

Thanks in advanced!