Hacking oreilly google hacks, 1st edition

Page 157

my $output = qq{"$title","$url","$source","$date_age","$description"\n}; $output =~ s!!!g; # drop all HTML tags print $output; } Figure 4-2. Google News results for "monk detective"

47.2 Running the Script Run the script from the command line, specifying the Google News results HTML filename and name of the CSV file you wish to create or to which you wish to append additional results. For example, using news.html as our input and news.csv as our output:

$ perl news2csv.pl < news.html > news.csv Leaving off the > and CSV filename sends the results to the screen for your perusal.

47.3 The Results The following are some of the 54 results returned by a Google News search for monk detective and using the HTML page of results shown in Figure 4-2:

"title","link","source","date or age", "description" "ON TV : That Was Then is already gone", "http://www.nwanews.com/adg/story_style.php?storyid=9127", "Arkansas Democrat Gazette, AR", "12 hours ago",


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.