'."\n"; # Make sure there is a world writable directory named "cache" in the same # directory this file is in. define('FEED_TITLE', 'My cool aggregated feed'); define('FEED_LINK', 'http://www.lordb.de'); define('FEED_DESCRIPTION', 'Yet another sample feed.'); define('FEED_LANG', 'en-us'); define('FEED_MAX_ITEMS', 10); define('CACHE_DURATION', 1800); # in seconds; feed is only reloaded after this # duration has expired. $FEED_SOURCES = array( 'http://daniel-schmid.blogspot.com/feeds/posts/default?alt=rss', 'http://buckleberry-fern-diaries.blogspot.com/feeds/posts/default?alt=rss' ); ?> <?php echo FEED_TITLE; ?> set_feed_url($FEED_SOURCES); $feed->set_cache_duration(CACHE_DURATION); // The cache duration $feed->enable_xml_dump(isset($_GET['xmldump'])); $success = $feed->init(); // Initialize SimplePie $feed->handle_content_type(); // Take care of the character encoding function format_authors($authors) { if (!isset($authors)) return; $is_first = true; foreach ($authors as $author) { if ($is_first) $is_first = false; else echo ', '; $name = $author->get_name(); if (!isset($name)) $name = $author->get_email(); echo $name; } } function format_categories($categories) { if (!isset($categories)) return; $is_first = true; foreach ($categories as $category) { if ($is_first) $is_first = false; else echo ', '; echo $category->get_label(); } } if ($success) { $curItem = 0; foreach($feed->get_items() as $item) { if ($curItem == FEED_MAX_ITEMS) break; ?> <?php echo $item->get_title(); ?> get_permalink(); ?> get_description(); ?> get_authors()); ?> get_permalink(); ?> get_date('r'); ?> get_categories()); ?>