WWW::OpenSearch::Response(3pm)

WWW::OpenSearch::Response3pm

Encapsulate a response received from an a9 opensearch compatible engine

Usage

    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;

Overview

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.

Constructor

new( $response )

Constructs a new instance of WWW::OpenSearch::Response from the WWWW::OpenSearch:Response returned by the search request.

Methods

parse_response( )

Parses the content of the HTTP response using XML::Feed. If successful, parse_feed( ) is also called.

parse_feed( )

Parses the XML::Feed originally parsed from the HTTP response content. Sets the pager object appropriately.

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="previous/next" href="..." /> tag, the page will simply be the parsed content of the URL 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.

_get_link( $type )

Gets the href attribute of the first link whose rel attribute is equal to $type.

Accessors

feed( )

pager( )

Releases

10 releases since Debian 4.0 (Etch); the text changed 6 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8–10
  6. 11
  7. 12–13

Author

•

Tatsuhiko Miyagawa <[email protected]>

•

Brian Cassidy <[email protected]>

From libwww-opensearch-perl 0.17-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.