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.  You can see this in action on my web site

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


Leave a Reply

Your email address will not be published. Required fields are marked *