It's possible to write a parser which is able to detect the feed URL (if present) from a standard web URL. For example: if the user enters www.drupal.org, the parser find http://drupal.org/node/feed, and parse this instead of the originally entered URL.

Comments

budda’s picture

aka parsing of auto discovery urls, such as <link rel="alternate" type="application/rss+xml" title="drupal.org RSS" href="http://drupal.org/node/feed" />

SimplePie library has some existing code to take care of this, line 10092 function autodiscovery()

aron novak’s picture

Assigned: Unassigned » aron novak

Yeah, but SimplePie is not the only parser. I would like to see coherent feature list not depending on which parser is used.
I'm not sure that the basic FeedAPI package have to contain this feature or not. It is a really comfortable feature btw.

budda’s picture

I was actually meaning to take code from simplepie and implement it in to the main feedapi system.

aron novak’s picture

I'm curious if it's possible to implement auto-detecting in FeedAPI smaller size than simplepie's proper function (and their dependant function) does this job.
Well, i looked into SimplePie's code. autodiscovery functions needs the whole SimplePie_Misc object for example.
I prefer a more compact solution for this. For example here (http://keithdevens.com/weblog/archive/2002/Jun/03/RSSAuto-DiscoveryPHP) the guy solve this in one function and in 62 lines.
budda, or do you have specific ideas to get the autodiscovery function from SimplePie elegantly without SimplePie's other part?

lopolencastredealmeida’s picture

I would propose that:

    If SimplePie is in use its function should be used
    else the "default" one based on Keith Devens should be used

Another option would be to create a hook that could be adapted by developers to wrap their own autodiscovery function

budda’s picture

How many ways is there to really discover a feed url? why not just use the Keith Devens one to cover all bases?

budda’s picture

Version: 5.x-0.x-dev » 5.x-1.x-dev
Status: Active » Fixed

I just added a couple of feeds on a test site, the feed urls were just the actual site url. both were parsed and the feed items extracted fine -- so does this mean autodiscovery is already implemented somewhere??

budda’s picture

Status: Fixed » Active

UPDATE: This is probably already working because SimplePie was my parser and that checks the feed URL during the init() call from parser_simplepie.module

So maybe stick Keith Devens code in to the other parser module - _parser_common_syndication_download() seems like a suitable place?

aron novak’s picture

I read the RSS Autodiscovery specification (http://www.rssboard.org/rss-autodiscovery) and seems that Keith Devens code ignores <base href="http://baseurl/path//"> .
I'm going to write another way (maybe it's possible to do easier? Not sure now) to get RSS links, but with using <base> is present.

aron novak’s picture

Status: Active » Fixed

I added the RSS Autodiscovery capability to parser_common_syndication . It's still experimental feature, please make sure if it works as expected.

Anonymous’s picture

Status: Fixed » Closed (fixed)