Syndication feed auto-discovery
use Feed::Find; my @feeds = Feed::Find->find('http://example.com/');
Feed::Find implements feed auto-discovery for finding syndication feeds, given a \s-1URI\s0. It (currently) passes all of the auto-discovery tests at http://diveintomark.org/tests/client/autodiscovery/.
Feed::Find will discover the following feed formats:
\s-1RSS\s0 0.91
\s-1RSS\s0 1.0
\s-1RSS\s0 2.0
Atom
Given a \s-1URI\s0 $uri, use a variety of techniques to find the feeds associated with that page. If $uri itself points to a feed (i.e., if the Content-Type of the response is a recognized feed type), returns $uri.
Returns a list of feed URIs.
The following techniques are used:
If the page contains any <link> tags in the <head> section, these tags are examined for recognized feed content types. The following content types are treated as feeds: application/x.atom+xml, application/atom+xml, application/xml, text/xml, application/rss+xml, and application/rdf+xml.
If the page does not contain any known <link> tags, the page is then scanned for <a> tags for links to URIs with certain file extensions. The following extensions are treated as feeds: .rss, .xml, and .rdf. Note that this technique is employed only if the first technique returns no results. Given a reference to a string $html containing an \s-1HTML\s0 page, uses the same techniques as described above in find to find the feeds associated with that page.
If you know the \s-1URI\s0 of the page, you should provide it in $base_uri, so that relative links can be properly made absolute. Feed::Find will attempt to determine the correct base \s-1URI\s0, but unless that \s-1URI\s0 is specified in the \s-1HTML\s0 itself (in a \*(C`<meta>\*(C' tag), you'll need to supply it yourself.
Returns a list of feed URIs.
Feed::Find is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
Except where otherwise noted, Feed::Find is Copyright 2004 Benjamin Trott, [email protected]. All rights reserved.