$cacheperiod); if($cache_too_old) { $url = "https://mozilla.org/firefox/notes/"; if(function_exists('curl_init')) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); $str = curl_exec($ch); if(curl_error($ch)) { echo curl_error($ch); die(); } curl_close($ch); } else { // If the cURL library isn't installed, just use file_get_contents() $str = file_get_contents($url); } preg_match('/(
.+<\/p>)/', $str, $odcs); // extract the element containing the release date $origdate = str_replace('
', "", str_replace('', "", $odcs[0])); // extract the date string
$udate = strtotime($origdate) + 43200; // convert said date string to the unix timestamp for noon GMT on that date
$rssdate = "D, d M Y H:i:s";
$date = date($rssdate, $udate); // convert unix timestamp to the date format RSS uses
$updatetime = date($rssdate, filemtime($fname)); // generating some data to fill out optional elements of the RSS feed.
$ttl = $cacheperiod / 60; // This is the sole reason why a few variables exist.
$output = "