Why would you want the output to be like Magpie? Magpie is incredibly difficult and annoying to use, IMO.
I wish there was a better way to do the cache lifetime. Been thinking about it a while. Current best way:
PHP Code:
<?php
// get a feed every hour
function hourly_feed() { return 3600; }
add_filter( 'wp_feed_cache_transient_lifetime', 'hourly_feed');
$feed = fetch_feed( 'http://example.com/feedurl' );
remove_filter('wp_feed_cache_transient_lifetime', 'hourly_feed');
// loop through the first five items, display title and content, with title linked
foreach ($feed->get_items(0, 5) as $item) { ?>
<h2 class="title"><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
<?php echo $item->get_content();
} ?>
Perhaps an extra option needs to be added to fetch_feed, to remove that filter nonsense. I'll make a ticket for it.
Edit: yes, I know you can filter on feed url as well, like so:
PHP Code:
function hourly_feed($age, $url) {
if ($url == 'http://example.com/feedurl') $age=3600;
return $age;
}
add_filter( 'wp_feed_cache_transient_lifetime', 'hourly_feed',10,2);
Maybe removing the extraneous filter from fetch_feed makes more sense.
Hmm.. Actually, there's a bug here. Fixing it would be best.