Previous Section  < Day Day Up >  Next Section

2.2. Assumptions

These hacks do assume a little more than an adventurous spirit and a researcher's tenacity. We assume that you already have some programming background or are willing to learn the basics as you go along. In fact, we've been happy to hear about so many readers picking up and learning a little programming through the hacks in the previous edition of this book; learning to program is so much easier if you have a particular task in mind.

You'll need to type in (or download) programs or scripts and run them from the command line (that's Terminal in Mac OS X or the DOS command window in Windows). Some are run as CGI scripts, bits of dynamic content running on your web site and talked to through your web browser. For more information on running hacks on the command line and as CGI scripts in your browser, see "How to Run the Hacks" in the Preface.

Almost all of the hacks are written in Perl (, with a few Python (, PHP (, Java (, and .NET ( programs sprinkled throughout. To run a particular hack, you'll need the appropriate language to be available on your computer. Since instruction on installing and using these languages is beyond the scope of this book, you should start with a visit to the language's home page and might consider picking up a copy of one of O'Reilly's fine selection of books ( Learning Perl by Randal L. Schwartz and Tom Phoenix (O'Reilly) will be particularly useful.

Most of the hacks use the Google API. For an introduction to the programmatic side of Google, a detailed walkthrough of the Google API, and examples of programming Google using Perl, Python, PHP, Java, and .NET, turn to Chapter 9.

There are also a few hacks that involve spidering or screen scraping—which is essentially using your program to read a site's web pages and extract salient information—to get to data that are either not available through the Google API or on another site entirely. If spidering appeals to you, you might also check out Spidering Hacks by Kevin Hemenway and Tara Calishain (O'Reilly).

    Previous Section  < Day Day Up >  Next Section