{"id":50,"date":"2006-08-23T09:20:17","date_gmt":"2006-08-23T17:20:17","guid":{"rendered":"http:\/\/simplepie.org\/blog\/2006\/08\/23\/sorting-multiple-feeds-by-time-and-date\/"},"modified":"2013-05-15T01:23:29","modified_gmt":"2013-05-15T09:23:29","slug":"sorting-multiple-feeds-by-time-and-date","status":"publish","type":"post","link":"https:\/\/simplepie.org\/blog\/2006\/08\/23\/sorting-multiple-feeds-by-time-and-date\/","title":{"rendered":"Sorting multiple feeds by time and date"},"content":{"rendered":"<div class=\"chunk\">\n<p><em><strong>Update:<\/strong> With the release of SimplePie 1.0, this tutorial became obsolete.  <a href=\"http:\/\/simplepie.org\/wiki\/tutorial\/sort_multiple_feeds_by_time_and_date\">Please check out the new tutorial instead<\/a>.<\/em><\/p>\n<p>In this demo, I will show you how to parse multiple feeds and sort all of the posts from all feeds in reverse-chronological order (newest to oldest).<\/p>\n<\/div>\n<div class=\"chunk\">\n<h4>What you&#8217;ll need for this demo<\/h4>\n<ul>\n<li>The Multifeeds package<\/li>\n<li>And, of course, the latest <a href=\"http:\/\/www.simplepie.org\/downloads\/\">SimplePie<\/a> for the RSS parsing (1.0 Beta 2 or later)<\/li>\n<\/ul>\n<\/div>\n<div class=\"chunk\">\n<h4>What you need to do<\/h4>\n<ol>\n<li>Unzip the <code>multifeeds.zip<\/code> file.<\/li>\n<li>Drop the latest version of <code>simplepie.inc<\/code> into the resulting folder.<\/li>\n<li>Edit &#8212; or don&#8217;t edit &#8212; the index.php file to your heart&#8217;s delight. (Maybe you should just let it run untouched the first time.)<\/li>\n<li>Upload the whole <code>multifeed<\/code> folder to your webserver (or your localhost)<\/li>\n<li>Set the cache folder to server-writable.<\/li>\n<li>Load the <code>index.php<\/code> into your web browser, and voila!<\/li>\n<\/ol>\n<\/div>\n<div class=\"chunk\">\n<h4>Notes<\/h4>\n<ol>\n<li>The very first time you load the page will take more time than the subsequent load will because SimplePie needs to cache all of the feeds for the first time.<\/li>\n<li>In the feeds you use, make sure that the items in that feed have a published or last modified date associated with them.  If not, then those feed items will be shuffled out of order.<\/li>\n<li>Because SimplePie Beta 3 has support for something called HTTP Conditional Get, cache handling is much improved over Beta 2, leading to better overall performance.<\/li>\n<\/ol>\n<\/div>\n<h4>Live Demo<\/h4>\n<p>&rarr; <a href=\"http:\/\/simplepie.org\/demo\/demos\/multifeed\/\">Multiple Feeds Demo<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: With the release of SimplePie 1.0, this tutorial became obsolete. Please check out the new tutorial instead. In this demo, I will show you how to parse multiple feeds and sort all of the posts from all feeds in reverse-chronological order (newest to oldest). What you&#8217;ll need for this demo The Multifeeds package And, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-demos"],"_links":{"self":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":1,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":194,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/posts\/50\/revisions\/194"}],"wp:attachment":[{"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simplepie.org\/blog\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}