RSS/ATOM Feeds Processing PHP Class Description

Monday, February 05, 2007

This is a PHP script for fetching RSS/ATOM feeds complete with caching and template driven output. It uses SimplePie to fetch the feeds and a customized version of XTemplate templating engine for generating the HTML output. Thanks to SimplePie it can autodetect and correctly interpret RSS 0.91, RSS 1.0, RSS 2.0 as well as ATOM 0.3 and ATOM 1.0.

The script will attempt to autodetect the most commonly used tags in RSS/ATOM fields so you will not have to worry about the fact that different feeds have different structure (read in the manual about the autodiscover property). Note that this property will try and get the most commonly used tags (title, author, link, date, etc) but if you want to go berserk and use all the tags from your favourite feed than you should reffer to the item property. Also, the global details of the feed can be accessed through the feed property. Read the manual and if you don't get it look into the example file. Or the other way around...

However, the true power of this script is that you can have cool looking RSS/ATOM feeds on your site in a matter of minutes just by writing four lines! And that's because besides fetching the RSS/ATOM feeds for you, the script can also display them in whatever form you want by using HTML templates. Check out the templates/default folder to see the default template looks like and customize it to your own needs. Note that the property that controls which template the script should use, is called (who would've thought?!) template

Go play with the example, read into the documentation and post comments!

1 comments:

  1. Tim said...

    Hello Mr. Gabos,

    First I wanna say that this rss/atom feed script really works well. I had the thing up and
    running in about five minutes, and I don't even know what the heck I'm doing!

    I'm a php programmer of only a few years, and I'm still somewhat new to useing classes, so if you'd bear with the questions of a newbie I'd sure appreciate it.

    I'd like to have several feeds on the same page, but I'd like to use a different template for each. Is there a way I could call for different templates into the parse method?

    Thank you very much for your time and your work,

    Timothy, MN

Post a Comment

GlossyBlue Blogger by Black Quanta. Theme & Icons by N.Design Studio
Entries RSS Comments RSS