<html><head><title>
<?php
$filename = 'http://rss.stumbleupon.com/user/.../comments'; // Location of your review feed
$limit = '-7 days'; // Maximum age of items
echo $filename;
?></title></head><body><dl>
<?php
$timelimit = strtotime($limit);
$rss=simplexml_load_file('comments'); // Open the feed
foreach ($rss->channel->item as $item) // Examine each item in the feed
{
$date = strtotime($item->pubDate);
if ($date >= $timelimit) // Don't show old stuff
{
$link = $item->link;
$title = htmlentities($item->title, ENT_QUOTES, "UTF-8"); // Turn single and double quotes into entities
$tmp = (string) $item->description; // This is to work around the presence of CDATA tags.
$tmp = preg_replace("/\[CDATA\](.*?)\[\/CDATA\]/ies", "base64_decode('$1')", $tmp);
echo <<<OUT
<dt><a href="$link" title="$title" rel="nofollow">$title</a></dt><dd>$tmp</dd>
OUT;
}
}
?>
</dl></body></html>
« Return to "Thing #17"
on The Electronic Replicant