tags:

views:

28

answers:

3

I want to programmatically check if a site has feeds. How can I do that?

Are there standard feed locations? Parsing the code for link tags with application/rss+xml attribute would be enough?

Thank you.

+4  A: 

Parsing the code for link tags with application/rss+xml attribute would be enough?

As far as I know, it is the only standard way to discover feeds. But that is no guarantee that you'll find them all.

troelskn
Just to spare the next one the momentary confusion I had, we're talking about actualy `<link>` tags here, not `<a>` tags; and yes, as far as I know this is the standard way +1
Michael Haren
Thank you very much both!
john
+1  A: 

You might want to read this resource for information on discovering feeds. Replace "application/atom+xml" with "application/rss+xml" as necessary.

Fraxtil
Thank you, very useful!
john
A: 

Use the Zend_Feed classes from Zend_Framwework. Zend_Feed::findFeeds does what you want.

StrangeElement
Fantastic! Right under my eyes... Thank you.
john