.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "WWW::OpenSearch::Response 3pm" .TH WWW::OpenSearch::Response 3pm "2021-01-02" "perl v5.32.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" WWW::OpenSearch::Response \- Encapsulate a response received from an A9 OpenSearch compatible engine .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use WWW::OpenSearch; \& \& my $url = "http://bulkfeeds.net/opensearch.xml"; \& my $engine = WWW::OpenSearch\->new($url); \& \& # Retrieve page 4 of search results for "iPod" \& my $response = $engine\->search("iPod",{ startPage => 4 }); \& for my $item (@{$response\->feed\->items}) { \& print $item\->{description}; \& } \& \& # Retrieve page 3 of results \& $response = $response\->previous_page; \& \& # Retrieve page 5 of results \& $response = $response\->next_page; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" WWW::OpenSearch::Response is a module designed to encapsulate a response received from an A9 OpenSearch compatible engine. See http://opensearch.a9.com/spec/1.1/response/ for details. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .ie n .SS "new( $response )" .el .SS "new( \f(CW$response\fP )" .IX Subsection "new( $response )" Constructs a new instance of WWW::OpenSearch::Response from the WWWW::OpenSearch:Response returned by the search request. .SH "METHODS" .IX Header "METHODS" .SS "parse_response( )" .IX Subsection "parse_response( )" Parses the content of the \s-1HTTP\s0 response using XML::Feed. If successful, parse_feed( ) is also called. .SS "parse_feed( )" .IX Subsection "parse_feed( )" Parses the XML::Feed originally parsed from the \s-1HTTP\s0 response content. Sets the pager object appropriately. .SS "previous_page( ) / next_page( )" .IX Subsection "previous_page( ) / next_page( )" Performs another search on the parent object, returning a WWW::OpenSearch::Response instance containing the previous/next page of results. If the current response includes a <link rel=\*(L"previous/next\*(R" href=\*(L"...\*(R" /> tag, the page will simply be the parsed content of the \s-1URL\s0 specified by the tag's href attribute. However, if the current response does not include the appropriate link, a new query is constructed using the startPage or startIndex query arguments. .ie n .SS "_get_link( $type )" .el .SS "_get_link( \f(CW$type\fP )" .IX Subsection "_get_link( $type )" Gets the href attribute of the first link whose rel attribute is equal to \f(CW$type\fR. .SH "ACCESSORS" .IX Header "ACCESSORS" .SS "feed( )" .IX Subsection "feed( )" .SS "pager( )" .IX Subsection "pager( )" .SH "AUTHOR" .IX Header "AUTHOR" .IP "\(bu" 4 Tatsuhiko Miyagawa .IP "\(bu" 4 Brian Cassidy .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2005\-2013 by Tatsuhiko Miyagawa and Brian Cassidy .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.