Reading RSS Feeds with Python and PHP

I did this for a site I was working on, and thought I would share it.

Simple RSS Parser with Python and PHP

If you want to throw a feed into your web page, one way I have found that works well is to use the Python feed parser module.  The way I do it is just put the data into a PostgreSQL database table and then truncate the table each time I pull the feed again.  The python script runs on my CentOS server using cron. 

One cautionary note is that some RSS providers explicitly state in their terms not to do this, so in the near future I may be removing some of these from the web site. Obviously the credentials have been removed from the code.

Here is the Python code, it’s very simple.  This code was for The Drudge Report.

Simple PHP database class to grab the new feeds out of the database.

Then pull it into your page