Initial revision
[libwww-opensearch-perl.git] / README
1 NAME\r
2     WWW::OpenSearch - Search A9 OpenSearch compatible engines\r
3 \r
4 SYNOPSIS\r
5         use WWW::OpenSearch;\r
6     \r
7         my $url = "http://bulkfeeds.net/opensearch.xml";\r
8         my $engine = WWW::OpenSearch->new($url);\r
9     \r
10         my $name = $engine->description->ShortName;\r
11         my $tags = $engine->description->Tags;\r
12     \r
13         # Perform search for "iPod"\r
14         my $response = $engine->search("iPod");\r
15         for my $item (@{$response->feed->items}) {\r
16             print $item->{description};\r
17         }\r
18     \r
19         # Retrieve the next page of results\r
20         my $next_page = $response->next_page;\r
21         for my $item (@{$next_page->feed->items}) {\r
22             print $item->{description};\r
23         }\r
24 \r
25 DESCRIPTION\r
26     WWW::OpenSearch is a module to search A9's OpenSearch compatible search\r
27     engines. See http://opensearch.a9.com/ for details.\r
28 \r
29 CONSTRUCTOR\r
30   new( $url )\r
31     Constructs a new instance of WWW::OpenSearch using the given URL as the\r
32     location of the engine's OpenSearch Description document (retrievable\r
33     via the description_url accessor).\r
34 \r
35 METHODS\r
36   fetch_description( [ $url ] )\r
37     Fetches the OpenSearch Descsription found either at the given URL or at\r
38     the URL specified by the description_url accessor. Fetched description\r
39     may be accessed via the description accessor.\r
40 \r
41   search( $query [, \%params] )\r
42     Searches the engine for the given query using the given search\r
43     parameters. Valid search parameters include:\r
44 \r
45     * startPage\r
46     * totalResults\r
47     * startIndex\r
48     * itemsPerPage\r
49 \r
50     See http://opensearch.a9.com/spec/1.1/response/#elements for details.\r
51 \r
52   do_search( $url [, $method] )\r
53     Performs a request for the given URL and returns a\r
54     WWW::OpenSearch::Response object. Method defaults to 'GET'.\r
55 \r
56 ACCESSORS\r
57   description_url( [$description_url] )\r
58   agent( [$agent] )\r
59   description( [$description] )\r
60 AUTHOR\r
61     * Tatsuhiko Miyagawa <miyagawa@bulknews.net>\r
62     * Brian Cassidy <bricas@cpan.org>\r
63 \r
64 COPYRIGHT AND LICENSE\r
65     Copyright 2006 by Tatsuhiko Miyagawa and Brian Cassidy\r
66 \r
67     This library is free software; you can redistribute it and/or modify it\r
68     under the same terms as Perl itself.\r
69 \r