From: Michael Prokop Date: Wed, 10 Jan 2007 22:51:01 +0000 (+0100) Subject: add script gsuggest.pl - google suggest X-Git-Tag: 0.9.12~2 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=90406bca74627308c83a07bec5419ef8b834136f add script gsuggest.pl - google suggest --- diff --git a/debian/changelog b/debian/changelog index d86969f..305d933 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-scripts (0.9.11) unstable; urgency=low + + * Added script gsuggest.pl: google suggest - ask google for + keyword suggestions + + -- Michael Prokop Wed, 10 Jan 2007 23:49:16 +0100 + grml-scripts (0.9.10) unstable; urgency=low * grml-slrn: do not activate 'set charset isolatin' and diff --git a/debian/rules b/debian/rules index eb2ba59..15aba17 100755 --- a/debian/rules +++ b/debian/rules @@ -55,7 +55,7 @@ binary-arch: build install dh_installdocs dh_installman manpages/grml-scripts.1 manpages/grml-bind.8 manpages/reread_partition_table.8 manpages/gtf.1 manpages/random-hostname.1 \ manpages/grml-setkeyboard.8 manpages/grml-setlang.8 manpages/getsf.1 manpages/grml-iptstate.8 manpages/qma.1 manpages/grml-swapon.8 \ - manpages/grml2ram.8 + manpages/grml2ram.8 manpages/gsuggest.1 # cp --no-dereference man/*.1.gz debian/grml-scripts/usr/share/man/man1/ dh_link /usr/sbin/blacklist /usr/sbin/unblacklist \ /usr/share/man/man1/grml-scripts.1.gz /usr/share/man/man1/align.1.gz \ diff --git a/manpages/gsuggest.1 b/manpages/gsuggest.1 new file mode 100644 index 0000000..0be7cc0 --- /dev/null +++ b/manpages/gsuggest.1 @@ -0,0 +1,24 @@ +.TH gsuggest.pl 1 +gsuggest.pl \- google suggest, ask google for keyword suggestions +.SH SYNOPSIS +.B gsuggest.pl +.RI keyword " [ another-keyword ]" +.SH DESCRIPTION +This manual page documents briefly the +.B gsuggest.pl +command. +.PP +\fBgsuggest.pl\fP is a program that asks google for keyword suggestions +for the given keyword[s]. +.SH USAGE EXAMPLE +.TP +.B gsuggest.pl grml +This will ask google for keyword suggestions based on the keyword 'grml' +and will return the results to standard out (stdout). +.SH OPTIONS +gsuggest.pl does not support any options. +.SH AUTHOR +gsuggest.pl was written by Michael Prokop . +.PP +This manual page was written by Michael Prokop +for the Debian project (but may be used by others). diff --git a/usr_bin/gsuggest.pl b/usr_bin/gsuggest.pl new file mode 100755 index 0000000..24af6be --- /dev/null +++ b/usr_bin/gsuggest.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl +# Filename: gsuggest.pl +# Purpose: google suggest - ask google for keyword suggestions +# Authors: grml-team (grml.org), (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +# Latest change: Mit Jän 10 23:40:04 CET 2007 [mika] +################################################################################ + +use strict; +use warnings; +use WebService::Google::Suggest; + +unless (@ARGV) { + print "usage: gsuggest \n"; + exit(1); +} + +my $suggest = WebService::Google::Suggest->new(); + +while (@ARGV) { + my @suggestions = $suggest->complete(shift); + for my $suggestion (@suggestions) { + print "$suggestion->{query}: $suggestion->{results} results\n"; + } +} + +## END OF FILE #################################################################