Simply Perfect RSS Parsing

RSS is a really useful tool for syndicating content between separate sites. Those people familiar with blogs and such are probably very familiar with RSS. Some of the clients where I work have taken advantage of RSS feeds provided by Web MD and other medical content providers to display new and updated content on their own practice websites. It’s a nice feature, especially for sites whose content doesn’t change all that often. You just need to be sure to check the terms of use for the site whose feed you want to use to make sure that type of use is allowed.

In the past I have pieced together ugly little scripts that parse the RSS feeds manually. But I recently came across a very nice library called SimplePie. Their website promotes the library as “Super-fast, easy-to-use, RSS and Atom feed parsing in PHP.” and that it is. I was able to take a 30 to 40 line script and shrink it down to 10 - 15 lines of code by using SimplePie.

One of the reasons CodeIgniter rocks is that it’s super easy to integrate with 3rd party libraries or code you’ve developed yourself. Elliot Haughin ported SimplePie over to a CI library which can be placed in any CI app very easily. This gives you all the power of SimplePie within the already powerful CI environment. If interested, head over to Elliot’s website and download the code.