summary refs log tree commit diff
path: root/README
diff options
context:
space:
mode:
authormiyagawa <miyagawa@65690182-5df0-0310-9871-95da5a3706e7>2004-12-14 10:50:39 +0000
committermiyagawa <miyagawa@65690182-5df0-0310-9871-95da5a3706e7>2004-12-14 10:50:39 +0000
commit4b350fb5e986459d250b954db625d6299d6bd630 (patch)
tree248466f5d0dbe2760ca927e1bc59f1d9a0ddb84a /README
downloadwebservice-google-suggest-4b350fb5e986459d250b954db625d6299d6bd630.tar.gz
Initial revision
git-svn-id: http://svn.bulknews.net/repos/public/WebService-Google-Suggest/trunk@1503 65690182-5df0-0310-9871-95da5a3706e7
Diffstat (limited to 'README')
-rw-r--r--README62
1 files changed, 62 insertions, 0 deletions
diff --git a/README b/README
new file mode 100644
index 0000000..4bef20d
--- /dev/null
+++ b/README
@@ -0,0 +1,62 @@
+NAME
+    WebService::Google::Suggest - Google Suggest as an API
+
+SYNOPSIS
+      use WebService::Google::Suggest;
+
+      my $suggest = WebService::Google::Suggest->new();
+      my @suggestions = $suggest->complete("goog");
+      for my $suggestion (@suggestions) {
+          print "$suggestion->{query}: $suggestion->{results} results\n";
+      }
+
+DESCRIPTION
+    WebService::Google::Suggest allows you to use Google Suggest as a Web
+    Service API to retrieve completions to your search query or partial
+    query. This module is based on Adam Stiles' hack
+    (http://www.adamstiles.com/adam/2004/12/hacking_google_.html).
+
+METHODS
+    new
+          $suggest = WebService::Google::Suggest->new();
+
+        Creates new WebService::Google::Suggest object.
+
+    complete
+          @suggestions = $suggest->complete($query);
+
+        Sends your $query to Google web server and fetches suggestions for
+        the query. Suggestions are in a list of hashrefs, for example with
+        query "Google":
+
+          @suggestions = (
+            { query => "google", results => 122000000 },
+            { query => "google toolbar", results => 2620000 },
+            ...
+          );
+
+        Note that "results" value does NOT contain commas and "results"
+        text.
+
+    ua
+          $ua = $suggest->ua;
+
+        Returns underlying LWP::UserAgent object. It allows you to change
+        User-Agent (Windows IE by default), timeout seconds and various
+        properties.
+
+AUTHOR
+    Tatsuhiko Miyagawa <miyagawa@bulknews.net>
+
+    This library is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+
+    This module gives you NO WARRANTY.
+
+SEE ALSO
+    http://www.adamstiles.com/adam/2004/12/hacking_google_.html
+
+    http://www.google.com/webhp?complete=1&hl=en
+
+    http://labs.google.com/suggest/faq.html
+