\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
$date – Successfully copied $file\n to $newfile”;
}
// ———–LAKEWEN 2————–
$file = ‘https://lakewenatcheeinfo.com/images/weather/jpeg/lake.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/LakeWen-2” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else
echo “
$date – Successfully copied $file\n to $newfile”;;

// ———–TRINITY————–
$file = ‘http://trinityconservancy.org/webimage.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/Trinity” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–PINECONE————–
$file = ‘http://www.pineconecabin.org/Images_Cam/Cabin.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/PineCone” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–KAHLER GLEN————–
$file = ‘http://63.142.209.227:8086/cgi-bin/snapshot.cgi’;
$weekday = date(“l”);
$newfile = “images/cam2/KahlerGlen” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}

// ———–OLD FAITHFUL————–
$file = ‘http://images.wsdot.wa.gov/us2/OldFaithful/OldFaithful.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/OldFaithful” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–STEVENS PASS EAST SUMMIT————–
$file = ‘http://images.wsdot.wa.gov/us2/Stevens/sumteast.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/StevensPassEast” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–STEVENS PASS WEST SUMMIT————–
$file = ‘http://images.wsdot.wa.gov/us2/stvldg/sumtwest.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/StevensPassWest” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo ”
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo ”
Successfully copied $file\n to $newfile”;
}

// ———–LOWER MILL CREEEK————–
$file = ‘http://images.wsdot.wa.gov/US2/LowerMillCrk/LowerMillCrk.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/LowerMillCreek” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–FISHLAKE————–
$file = ‘images/cam2/Fishlake-0.jpg’;
$weekday = date(“l”);
$newfile = “images/cam2/Fishlake” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
// ———–MIDWAY————–
$path = “images/Midway/FI9805P_00626E53699B/snap”;

$latest_ctime = 0;
$latest_filename = ”;

$d = dir($path);
while (false !== ($entry = $d->read())) {
$filepath = “{$path}/{$entry}”;
// could do also other checks than just checking whether the entry is a file
if (is_file($filepath) && filectime($filepath) > $latest_ctime) {
$latest_ctime = filectime($filepath);
$latest_filename = $entry;
}
}

// now $latest_filename contains the filename of the file that changed last

$file = “images/Midway/FI9805P_00626E53699B/snap/” . “$latest_filename”;
$weekday = date(“l”);
$newfile = “images/cam2/midway” . “$weekday” . “Noon” . “.jpg”;

if(!@copy($file, $newfile)) {
$errors= error_get_last();
echo “COPY ERROR: “.$errors[‘type’];
echo “
\n”.$errors[‘message’];
error_log(“failed to copy $file…\n”, 3, “wp-content/error_log”);
echo “failed to copy $file…\n”;
} else {error_log(“Successfully copied $file\n”, 3, “wp-content/error_log”);
echo “
Successfully copied $file\n to $newfile”;
}
$timezone = date_default_timezone_get();
echo “The current server timezone is: ” . $timezone;

// Change the line below to your timezone!
date_default_timezone_set(‘America/Los_Angeles’);

$date = date(‘m/d/Y h:i:s a’, time());
echo “
$date”;
}
?>