It's all spinning wheels and self-doubt until the first pot of coffee.

RSS plumbing in PHP nowhere to be found?

This actually surprises me: I can't find any simple RSS filters—or other basic feed plumbing fixtures—implemented in PHP.

I want a URL-line style PHP page which takes in an RSS feed URL and some search parameters, returning an RSS feed filtered according to the parameters. So, say, I want to filter a feed for only items containing a certain phrase in the description—or maybe I want items with osx in a dc:subject element.

And how about some blenders? That is, I pass in any number of feed URLs and get one merged feed out the other end. I've got a chapter in my book on these, in Python—but it'd be handy to have them in PHP as well.

Have I just not looked hard enough? By now, I'd've thought this sort of thing would be all tied up in a bow and at the top of the Google charts by now. It makes me wish I'd used PHP in my book, rather than Python—and only because of PHP's irresistible ubiquity. Coding in PHP still makes me gag, just a bit.

But, if the lazy web doesn't deliver, I guess I'll be cobbling it together myself soon.

Archived Comments

  • While I agree with you on the PHP front I had heard of an RSS parser in PHP called Magpie. I don't vouche for it though.

  • Gregarius http://gregarius.net does this in php using MagpieRSS. You can output the search results, tags, categories etc as rss feeds. It makes a nice blender (just append ?theme=rss to any gregarius URL).

    While it definitely is not a URL-line style app and might be overkill for your needs, I thought I would throw the suggestion out there....

  • I started doing something similar. I was using for specific feeds and didn't provide flexable input. Manipulating XML is PHP is easy though.

    Here is my example for removing ads from a moreover feed:


  • I tend to use this code snippet from Alf.

    There was some talk of sponsoring work on Magpie at one point, and feed generation was one of the proposed features, but I can't say I've ever felt moved to add it otherwise.

  • Yeah, as much I as prefer writing in Perl to PHP, there are so many apps in PHP that I like and use. I am surprised though by some of the missing pieces in PHP that other languages have had for years... Even stuff that would be considered somewhat basic by many. sigh...

  • There is also FeedOnFeeds-Redux (http://fofredux.sf.net) which uses Magpie for consumption and rsswriter for publication.

    It's a little behind some other projects - but aims for a simpler, more straight-line approach.

  • Magpie's probably the closest you're gonna come for PHP at the moment. Or at least, it was a year ago when I was still using PHP. Magpie, however, is utter crap compared to either the UFP or Rome or my FeedTools or really just about any other RSS parser. If I was forced to use PHP, I'd definately just write the parser myself. But thankfully, Ruby's stolen my heart, and I'll never go back.

    So I'd say, go for it. Write a decent PHP parser and make the life of all those poor PHP guys ever so slightly less painful. :-)