Suggestions for Parsing Blog Feeds Using PHP?
March 28, 2005 9:15 PM   Subscribe

Can anyone suggest good PHP books or existing scripts that can help me successfully parse RSS 1.0, 2.0 and Atom 0.3 feeds, then save them to a MySQL database?

I'm developing a website that aggregates entries from various blogs dedicated to a specific topic. (Blog authors have agreed to participate.) I've currently got a version working using Ari Paparo's RSStoMySQL script, but it only seems to work with RSS 1.0 feeds. I'm successfully converting some non-1.0 feeds using, but it isn't working for others. Basically the script seems very particular. Any suggestions on other ways I can also successfully scrape Atom and RSS 2.0 feeds? To be clear, my solution needs to save entries to a MySQL database so I can manage entries in several ways.
posted by jeanmari to Computers & Internet (3 answers total)
For an intro to working with PHP and MySQL, Luke Welling and Laura Thomson's PHP and MySQL Web Development is the best book on the market, IMO.

And parsing feeds is pretty easy with MagpieRSS, which handles the various flavors of RSS and Atom.
posted by ubernostrum at 10:04 PM on March 28, 2005

MagpieRSS will do the basic parsing for you, but will not save the feeds to a database. Feed on Feeds will, and so will Gregarius. They are both designed to be end-user apps rather than tools as part of a larger system, but don't let that bother you. They're open source, hack away!
posted by steveminutillo at 10:06 PM on March 28, 2005

The various versions of RSS and Atom aren't all that different from a parsing point of view. I'd figure out how the script works and modify it to support them - it's mostly just changing the names of some tags.

Also, knowing how your parser works will be useful when you find a feed that doesn't work properly and you get complaints.
posted by cillit bang at 5:36 AM on March 29, 2005

« Older What's the best pet insurance?   |   Working out and Testosterone Newer »
This thread is closed to new comments.