$value) $trans[$key] = ''.ord($key).';'; // dont translate the '&' in case it is part of &xxx; $trans[chr(38)] = '&'; } // after the initial translation, _do_ map standalone '&' into '&' return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($string, $trans)); } if (empty($hyvesname)) { $hyvesname = $_GET['h']; } if (empty($hyvesname)) { ?>

Deze service levert je een RSS feed
van iemand's weblog op Hyves.
Vul het vakje in, druk op submit en je kunt de gegenereerde url in je
eigen programmaatjes stoppen.
Opmerkingen, vragen e.d. kunnen via ... mijn Hyves page of die van Cogmios.
(waar anders).
Versie (broncode)
} else { header("location: http://www.hyves-feeds.nl/rss/hyver/" . $hyvesname . "/blog"); exit; // Aantal requests in de hand houden ivm belasting $ipfile = "cache/" . md5($_SERVER["REQUEST_ADDR"]) . ".ip"; if (file_exists($ipfile) && filemtime($ipfile)-time() < 2) sleep(2); touch($ipfile); $blogname = $hyvesname; $fullblog = 'http://'.$blogname.'.hyves.nl/blog/'; $cache = "cache/" . $blogname . ".html"; if (file_exists($cache) && filemtime($cache) > (time()-($cachemin*60))) { $file_contents = file_get_contents($cache); } else { touch($cache); $ch = curl_init(); $timeout = 5; // set to zero for no timeout curl_setopt ($ch, CURLOPT_URL, $fullblog); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); curl_setopt ($ch, CURLOPT_CRLF, 0); $file_contents = curl_exec($ch); curl_close($ch); $handle = fopen($cache,"w"); fwrite($handle,$file_contents); fclose($handle); } // $file_contents = utf8_encode(file_get_contents($fullblog)); // $file_contents = utf8_encode($file_contents); // $file_contents = iconv("UTF-8","UTF-8",file_get_contents($fullblog)); // $file_contents = file_get_contents($fullblog); $enc = mb_detect_encoding($file_contents); // if (empty($enc)) $enc="ISO-8859-1"; if (empty($enc)) $enc="CP1252"; // $file_contents = iconv($enc,"UTF-8",$file_contents); // $file_contents = utf8_encode($file_contents); // $enc="UTF-8"; $file_contents = stripslashes(str_replace("\\r","",str_replace("\\n","",$file_contents))); if (preg_match_all('|class="singlecontent_block">(.*?)|is', $file_contents, $matches)) { unset($matches[0]); if ($show!="source") { header ("Content-Type: text/xml; charset=" . $enc); printf(""."\n"); printf("Sorry, Hyves could not be reached or the name (" . $blogname . ") you supplied does not exist, or error parsing the html shown below!
"; echo ""; echo "" . htmlspecialchars($file_contents) . ""; /* header ("Content-Type: text/xml"); printf(""."\n"); printf("