googlesearch - command line interface to google search
I wanted to simply ask for top x results for something, and see a list of result urls.
googlesearch [OPTION].. TERMS..
-m number max results, default is 10. -t trim results display to fully qualified domain name -o override cache (set at 6 hours) -h help -v version
First 20 results for 'boston ice cream'
googlesearch -m 20 boston ice cream
You will need a ~/.googlesearch/config.yml file with: ___ LOCAL_GOOGLE_KEY: yourkey LOCAL_GOOGLE_KEY_REFERER: siteassociatedwithabovekey
This is a YAML file.
What is the google key and key referer? You will need to have a google account and google api key to use this cli. This is the LOCAL_GOOGLE_KEY noted in the config file. The referer is what website you generated that key for.
Generating a google search api key allows you to put a search in your website. It also allows you to use this interface to search in general. (I know- it seems like- why don't we just scrape http results, right? No. Grow up, rookie. They provide the api, use it.)
In development. If you notice bugs, or wish for extension, please contact the AUTHOR.
Google::Search Cache::File YAML
Leo Charre leocharre at cpan dot org
Copyright (c) 2010 Leo Charre. All rights reserved.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, i.e., under the terms of the "Artistic License" or the "GNU General Public License".
This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the "GNU General Public License" for more details.
To install googlesearch, copy and paste the appropriate command in to your terminal.
cpanm
cpanm googlesearch
CPAN shell
perl -MCPAN -e shell install googlesearch
For more information on module installation, please visit the detailed CPAN module installation guide.