best algorithm to combine multiple RSS feeds using Python
<p>I am writing a python script to combine about 20+ RSS feeds.  I would like to use a custom solution instead of feedjack or planetfeed.  </p>

<p>I use feedparser to parse the feeds and mysql to cache them.  </p>

<p>The problem I am running into is determining which feeds have already been cached and which haven't.</p>

<p>Some pseudo code for what I have tried:</p>

<ul>
<li>create a list of all feed items</li>
<li>get the date of last item cached from db</li>
<li>check which items in my list have a date greater than my item from the db and return this filtered list</li>
<li>sort the returned filtered list by date the item was created</li>
<li>add new items to the db</li>
</ul>

<p>I feel like this would work, but my problem is that not all of the dates on the RSS feeds I am using are correct.  Sometimes a publisher, for whatever reason, will have feed items with dates in the future.  If this future date gets added to the db, then it will always be greater than the date of the items in my list.  So, the comparison stops working and no new items get added to the db.  I would like to come up with another solution and not rely on the publishers dates. </p>

<p>How would some of you pros do this?  Assuming you have to combine multiple rss feeds, save them to a mysql db and then return them in ordered by date.  I'm just looking for pseudo code to give me an idea of the best way to do this. </p>

<p>Thanks for your help.</p>
