Skip to Content
Yahoo! Hacks
book

Yahoo! Hacks

by Paul Bausch
October 2005
Intermediate to advanced
489 pages
12h 2m
English
O'Reilly Media, Inc.
Content preview from Yahoo! Hacks

How to Run the Hacks

The programmatic hacks in this book run either on the command line (that’s Terminal for Mac OS X folk, DOS command window for Windows users) or as CGI (that’s “common gateway interface”) scripts—dynamic pages living on your web site, accessed through your web browser.

Command-Line Scripts

Running a hack on the command line invariably involves the following steps:

  1. Type the program into a garden-variety text editor: Notepad on Windows, TextEdit on Mac OS X, vi or Emacs on Unix/Linux, or anything else of the sort. Save the file as directed—usually as scriptname.pl (the pl bit stands for Perl, the predominant programming language used in Yahoo! Hacks).

    Alternately, you can download the code for all of the hacks online at http://www.oreilly.com/catalog/yahoohks, where there is a ZIP archive containing individual scripts saved as text files.

  2. Get to the command line on your computer or remote server. In Mac OS X, launch the Terminal (Applications Utilities Terminal). In Windows, click the Start button, select Run…, type command, and hit the Enter/Return key on your keyboard. In Unix…well, we’ll just assume you know how to get to the command line.

  3. Navigate to where you saved the script at hand. This varies from operating system to operating system, but usually involves something like cd~/Desktop (that’s your Desktop on the Mac).

  4. Invoke the script by running the programming language’s interpreter (e.g., Perl) and feeding it the script (e.g., scriptname.pl) like so:

    	$ 
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally

Publisher Resources

ISBN: 0596009453Supplemental ContentErrata Page