Software

by Fabrizio Coccetti, created 20040308, last update 20040908

Software List

Search engine in perl for Google

Using the search.pl script, written in perl, you can automatically query Google, save your results is a file, and much more.
This software was developed to use it with a web crawler to make complex graphs, for the project Complexity and its applications from nanometric to cosmic structures undertaken by Museo Storico della Fisica e Centro Studi e Ricerche Enrico Fermi.

Installation steps:

  1. Download the Google Web APIs developer's kit
  2. Create your Google account and obtain a license key (free of charge)
  3. Download the search.pl script (it uses the GNU General Public License)
  4. Make sure you have installed the modules SOAP::Lite and Getopt::Long
  5. Put the file GoogleSearch.wsdl (from the Google Web APIs developer's kit) in the same directory where you run search.pl

Usage and options:

search.pl <search-phrase> [OPTIONS]

Options (unique abbraviations are allowed):
-f, --file        output goes to file
-h, --help        display this help and exit
-l, --language    return only pages written in language (XY)
                   (use en for English, fr for French, ...
-k, --key         specify your google-key (mandatory)
-r, --results     number of URL results to display
-w, --waiting     wait time after one query of 10 URLs (to query google nicely)
The argument -k (--key) is mandatory,
to obtain you personal key, register at http://www.google.com/apis/

Examples:

search.pl "Hello world" --key=+mZ2pfxxyyxxyyxxyyxxyyxxyyxxyyxx
search google.com for the string "Hello World", using your personal key, you get 10 URLs.

search.pl "Hello world" -l it -r 500 -f res.txt -k +mZ2pfxxyyxxyyxxyyxxyyxxyyxxyyxx
search google.com for the string "Hello World",
return only pages written in Italian,
return 500 URLs,
write output to file res.txt,
specify your personal key.


[Home Page] [useful tips for linux]