WWW::O...esponse(3pm)
β¨ NAME β¨
WWW::OpenSearch::Response β bestie, it wraps up a response you got back from an A9 OpenSearch compatible engine π
πΈ SYNOPSIS πΈ
okay so first you gotta load it, then it's giving very demure, very mindful:
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;
like, paging through search results has never been this cunty π¦
π DESCRIPTION π
WWW::OpenSearch::Response is the module that exists purely to encapsulate a response received from an A9 OpenSearch compatible engine π
. If you want the lore, the spec is at http://opensearch.a9.com/spec/1.1/response/ β go read it, iykyk β¨
π CONSTRUCTOR π
new( $response )
Builds you a brand new WWW::OpenSearch::Response instance, constructed from the WWWW::OpenSearch:Response that the search request handed back π«Ά. (yes bestie, that typo is in the original, we're keeping her, no cap π)
π₯ METHODS π₯
parse_response( )
Parses the content of the HTTP response using XML::Feed π. And if that goes well? parse_feed( ) gets called too. slay β¨
parse_feed( )
Parses the XML::Feed that was originally parsed out of the HTTP response content πΈ. Then it sets the pager object appropriately, as it should π
previous_page( ) / next_page( )
Runs another search on the parent object, and hands you back a WWW::OpenSearch::Response instance holding the previous/next page of results π.
Here's the tea tho β: if the current response already includes a <link rel="previous/next" href="..." /> tag, then the page is literally just the parsed content of the URL that the tag's href attribute points at, periodt. BUT β and this is the plot twist β if the current response does not include the appropriate link, then a whole new query gets constructed using the startPage or startIndex query arguments π₯. so either way you're getting your page, bestie.
_get_link( $type )
Grabs the href attribute of the very first link whose rel attribute is equal to $type π― (underscore gang, this one's internal, iykyk).
π ACCESSORS π
feed( )
pager( )
two lil accessors, doing their lil jobs, iconic behavior honestly π
π AUTHOR π
the legends who made this happen:
- Tatsuhiko Miyagawa
<miyagawa@bulknews.net> - Brian Cassidy
<bricas@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself π«Ά
fr fr, keep those terms intact, they're the whole vibe check π
okay that's the whole page babes, perl v5.34.0, dated 2022-07-02, and this was WWW::O...esponse(3pm) β go forth and page through your search results, you absolute main character ππβ¨
π¦ where this page comes from
- debian bookworm: libwww-opensearch-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libwww-opensearch-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libwww-opensearch-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwww-opensearch-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwww-opensearch-perl 0.17-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms