RSS, Atom and SimplePie
#307 Henry, Sunday, 08 November 2015 10:16 AM (Category: Web Development)
(Tags: rss atom simplepie)

I've been tinkering with the problem of interpreting Atom XML for my news reader. Going round in circles, not having much success. I decided to see what ownCloud did with news, so I dug down into the code and found that they use a library called SimplePie.

This is a PHP library that will interrogate a feed, retrieve the XML for RSS and Atom, parse the XML, and simplify and clean the HTMl for the body of posts. In short, it does what I need, entirely.

There are some caveats. It produces some really awful logs. I can see them in the log files for the ownCloud news reader. Prolific ugly logs that are not timestamped so you have no idea when they were created. But I can live with that.

I downloaded it so I could test it. There's a problem. It uses an autoloader to get started. Since I started working with the book Modernizing Legacy Applications In PHP by Paul M. Jones, I have been using an autoloader too, and it really makes things easy. Trouble is, the SimplePie autoloader and the autoloader I currently use on all my websites, don't want to coexist. I have a lot of work to do to understand this situation, and see if I can tweak either of them to work together. I would like to save myself a lot of effort by using SimplePie, but it's not looking good so far.

0 comments