ZF-2251: Add OPML support to Zend_Feed::findFeeds

Description

As it exists now, Zend_Feed::findFeeds can locate feeds advertised in HTML documents. The attached patch enhances this method such that it can also locate feeds advertised in OPML feeds.

Comments

I don't think this feature would be a good idea for Zend_Feed.

First of all, current Zend_Feed::findFeeds implementation not only tries to discover available feeds but also parses them and returns a valid Zend_Feed_* instance. Because Zend_Feed doesn't support OPML at all any OPML support in Zend_Feed::findFeeds will cause Zend_Feed to raise an exception.

Finally, there's no valid reason to integrate OPML support in Zend_Feed as a syndication flavor. OPML is often used as an outline format, for example fo feed collections, and doesn't really fit current Zend_Feed feed format architecture.

"First of all, current Zend_Feed::findFeeds implementation not only tries to discover available feeds but also parses them and returns a valid Zend_Feed_* instance." The only reason I suggest that this feature function differently is because HTML files generally offer very few feeds, whereas an OMPL file generally contains many.

"Because Zend_Feed doesn't support OPML at all any OPML support in Zend_Feed::findFeeds will cause Zend_Feed to raise an exception." Please cite an example of this. As far as I'm aware, this patch works without breaking the existing feature or causing any other conflicts.

"Finally, there's no valid reason to integrate OPML support in Zend_Feed as a syndication flavor." That's incorrect. Any respectable feed aggregator, web-based or otherwise, offers OMPL import/export as a feature, including Google Reader, Bloglines, and Newsgator/FeedDemon. Don't take my word for it, check the FAQ page for any of those readers and see for yourself.

"OPML is often used as an outline format, for example fo feed collections, and doesn't really fit current Zend_Feed feed format architecture." That was its original purpose, yes, but it's obviously being used for other things now. See my last comment on feed aggregators using it as an import/export format. I wouldn't say the existing function really "fits" with Zend_Feed, either, so if it's going to have something that doesn't "fit," it may as well be as useful as possible.

Hi Matthew, thanks for your feedback.

{quote} The only reason I suggest that this feature function differently is because HTML files generally offer very few feeds, whereas an OMPL file generally contains many. {quote}

Reading the quoted line I guess I probably misunderstand your request. With "Add OPML support to Zend_Feed::findFeeds" do you actually mean

  1. enhance Zend_Feed in order to parse also OPML files and discover Atom/Rss feeds listed within the file

or

  1. enhance Zend_Feed in order to parse a classic URL and extract all Atom/Rss è OPML files?

Reading your last feedback I suppose your initial request was #1 but my interpretation was based on the #2nd option. Could you please clarify your request?

1 is what I actually meant. Zend_Feed:findFeeds already does this for HTML files. My patch merely makes some minor modifications so that it can also be used on OPML files.

I do apologize, Matthew, I misinterpreted your request. I'm reopening the ticket, I'll give a look at the patch in a few days.

I'm a little concerned about the suggestion to tweak Zend_Feed::findFeeds. I would add an additional importFromOpml instead or something like that. :)

"I would add an additional importFromOpml instead or something like that."

Fair enough. I can submitted a modified patch that takes that approach if need be.

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Please evaluate and categorize as necessary.

Reexamining the patch, I'm not sure it makes sense to have a separate method without abstracting common logic out of findFeeds(). The only real difference in the two processes in the expected structure of the document / how feed URLs are parsed from it. Everything else is the same. Thoughts?

Is this something we should push to 2.0? or is there a clear fix now?

I spoke with Padraic Brady over Twitter, being that this ticket relates to Zend_Feed and his component Zend_Feed_Reader is the preferred way of handling feeds at this point. He requested that I assign the ticket to him, set it for release in ZF2, and set its status to postponed (which is the only part I don't seem to be able to do myself).

Status updated to postponed - Zend\Feed in ZF 2.0 will include OPML fetch/read/write support to handle this and other OPML use cases. Reporter is welcome to hijack Zend\Feed if they want to work on this specific feature set ;).