.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Feed::Find 3" .TH Feed::Find 3 2023-01-20 "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Feed::Find \- Syndication feed auto\-discovery .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Feed::Find; \& my @feeds = Feed::Find\->find(\*(Aqhttp://example.com/\*(Aq); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fIFeed::Find\fR implements feed auto-discovery for finding syndication feeds, given a URI. It (currently) passes all of the auto-discovery tests at \&\fIhttp://diveintomark.org/tests/client/autodiscovery/\fR. .PP \&\fIFeed::Find\fR will discover the following feed formats: .IP \(bu 4 RSS 0.91 .IP \(bu 4 RSS 1.0 .IP \(bu 4 RSS 2.0 .IP \(bu 4 Atom .SH USAGE .IX Header "USAGE" .SS Feed::Find\->find($uri) .IX Subsection "Feed::Find->find($uri)" Given a URI \fR\f(CI$uri\fR\fI\fR, use a variety of techniques to find the feeds associated with that page. If \fI\fR\f(CI$uri\fR\fI\fR itself points to a feed (i.e., if the \&\fIContent-Type\fR of the response is a recognized feed type), returns \fI\fR\f(CI$uri\fR\fI\fR. .PP Returns a list of feed URIs. .PP The following techniques are used: .IP "1. \fI\fR tag auto-discovery" 4 .IX Item "1. tag auto-discovery" If the page contains any \fI\fR tags in the \fI\fR section, these tags are examined for recognized feed content types. The following content types are treated as feeds: \fIapplication/x.atom+xml\fR, \&\fIapplication/atom+xml\fR, \fIapplication/xml\fR, \fItext/xml\fR, \&\fIapplication/rss+xml\fR, and \fIapplication/rdf+xml\fR. .IP "2. Scanning \fI\fR tags" 4 .IX Item "2. Scanning tags" If the page does not contain any known \fI\fR tags, the page is then scanned for \fI\fR tags for links to URIs with certain file extensions. The following extensions are treated as feeds: \fI.rss\fR, \fI.xml\fR, and \fI.rdf\fR. .Sp Note that this technique is employed \fBonly\fR if the first technique returns no results. .ie n .SS "Feed::Find\->find_in_html(\e$html [, $base_uri ])" .el .SS "Feed::Find\->find_in_html(\e$html [, \f(CW$base_uri\fP ])" .IX Subsection "Feed::Find->find_in_html($html [, $base_uri ])" Given a reference to a string \fR\f(CI$html\fR\fI\fR containing an HTML page, uses the same techniques as described above in \fIfind\fR to find the feeds associated with that page. .PP If you know the URI of the page, you should provide it in \fR\f(CI$base_uri\fR\fI\fR, so that relative links can be properly made absolute. \fIFeed::Find\fR will attempt to determine the correct base URI, but unless that URI is specified in the HTML itself (in a \f(CW\*(C`\*(C'\fR tag), you'll need to supply it yourself. .PP Returns a list of feed URIs. .SH LICENSE .IX Header "LICENSE" \&\fIFeed::Find\fR is free software; you may redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHOR & COPYRIGHT" .IX Header "AUTHOR & COPYRIGHT" Except where otherwise noted, \fIFeed::Find\fR is Copyright 2004 Benjamin Trott, ben+cpan@stupidfool.org. All rights reserved.