On Keith Deven's weblog today, there's a new posting with a handy script to help with auto-discovery of RSS feeds with PHP.
I'm in the process of writing my own RSS aggregator. Naturally, I wanted to be able to use the new RSS auto-discovery method which has evolved over the past few days. Mark Pilgrim made some Javascript bookmarklets and a Python implementation to do this, but I needed a PHP implementation, so I wrote one.
His example script takes in the raw HTML for a page (easy enough to get) and the location it came from. From there, via a series of loops, it looks for the <link> tags and parses out which is the most likely to be the link to the site's RSS feed. I've used something like this with NewsGator and it's nice to not have to search all over for a feed - just point it at the URL and it does the rest...




