A Decent RSS Parser for PHP
I use MagpieRSS a lot when I’m trying to parse RSS files with PHP. It forms the backbone for the spider that drives all of the sites that make up Jack’s Sports Report as well other small tasks here and there. For example, I use MagpieRSS to parse weather feeds for Fore Score Golf Stats so our users can get real-time information on their local weather and the conditions at their favorite courses.
There’s a major competitor to Magpie in this space called SimplePie that a lot of people prefer. Development on Magpie has basically stalled since late last year while SimplePie improvements have been coming fast and steady for awhile. You probably can’t go wrong using either one. I stick with Magpie mostly because it’s what I’m familiar with. Magpie is also built straight into WordPress now which might be advantageous to a lot of plugin developers.
A person could most certainly write their own RSS parser using PHP5’s XML functions. I prefer using a library because it handles most of the dirty work for me and it saves on time.










This is Ryan, the creator and co-developer of SimplePie. Once upon a time, I was also a Magpie user. As a matter of fact, SimplePie got it’s name from “A Simple API for Magpie,” as the earliest versions of SimplePie were geared for making RSS parsing easier for PHP newbie’s (of which I was one at the time).
I could launch into all of the ways that I believe SimplePie is better, but I’m heavily biased. I can tell you, however, that a large number of Magpie users who have taken SimplePie for a spin have been very happy with the switch.
In regards to writing your own RSS software, I can tell you that RSS is rarely ever actually valid XML. You need to build in certain cleanup routines before passing it into an XML parser (SimpleXML, for example). You’d also need to fetch the feed in the first place, cache it, and then have a way to interact with it. That doesn’t even touch on supporting the actual specifications themselves.
Just my 2 cents. :)
Comment by Ryan Parman — October 4, 2007 @ 4:50 pm
Thanks for the comment, Ryan. I should probably give SimplePie another run.
I’m with you 100% about all the reasons you listed for not writing your own parser. There’s no need to reinvent the wheel. I was just pointing out that you could go that way if you wanted to.
Comment by Link — October 8, 2007 @ 12:35 pm