PDA

View Full Version : RSS Feed


gigiloumill
11-28-2009, 12:59 PM
Guys, I put together this RSS feed script and I was wondering if someone would know how to include a code to display the storyline (description) and maybe pictures. This code is set up to run with magpierss. Here's the code.. Thanks

<?php


require_once('rss_fetch.inc');

// how many feeds?
$num_items = 5;
// RSS feed
$rss = fetch_rss( 'http://rss.cnn.com/rss/cnn_topstories.rss' );

if($rss) {
$items = array_slice($rss->items, 0, $num_items);

echo "<ul>";
foreach ($items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=\"$href\" rel=\"nofollow\">$title</a></li>";
}
echo "</ul>";
} else {
echo "<p>Feed currently updating. Please check back soon.</p>";
}
?>