2013-04-09 65 views
1

PHP中是否有任何脚本或类可以让我定义不同的RSS提要,让它们在按日期排序的页面上输出?php多饲料rss解析器?

我想要一个页面,将RSS源从多个源解析捆绑在一起,但按日期排序。

回答

2

可以做到这一点的一个脚本是SimplePie。请参阅Sort multiple feeds by time and date

// Create a new SimplePie object 
$feed = new SimplePie(); 

// Instead of only passing in one feed url, we'll pass in an array of three 
$feed->set_feed_url(array(
    'http://digg.com/rss/index.xml', 
    'http://feeds.tuaw.com/weblogsinc/tuaw', 
    'http://feeds.uneasysilence.com/uneasysilence/blog' 
)); 

// Initialize the feed object 
$feed->init(); 

// This will work if all of the feeds accept the same settings. 
$feed->handle_content_type(); 

foreach ($feed->get_items() as $item) { 
    $item->get_title(), "\n"; 
} 
+0

非常好,正是我需要的,谢谢! – NaughtySquid 2013-04-09 15:05:00