spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column55

Google SVG Search I

Developer News
Google to Shake Up Browsers With Own Launch
Mozilla's Ubquity Mashup: For The Masses?
iPhone Users Just Want to Have Fun

In the next couple of installments we will make use of our previously acquired knowledge on the Google Web Services API and SVG in order to produce a CGI that graphically presents the search engine results returned by Google.

Installing SOAP::Lite

We will start at the Web services end of things and use perl's SOAP::Lite package to build a SOAP client that will use Google's API to retrieve search engine results for any given query. First we need to install SOAP::Lite from the Comprehensive Perl Archive Network, which is pretty much CPAN standard:

perl -MCPAN -e 'install SOAP::Lite'

Or if you do not have CPAN.pm installed, download the package from the above location, untar and run:

   perl Makefile.PL
   make
   make test
   make install

SOAP::Lite comes, despite its name, with full-blown inplementations for stand-alone SOAP clients, CGI clients and servers, and stand-alone SOAP servers with HTTP support. It is also the most advanced free Perl toolkit on the block by being able to dynamically generate all necessary code automatically from a Web Services Definition Language (WSDL) file. Other toolkits and languages require you to manually generate code or even hand-code it yourself.

Calling Google via SOAP

All this makes our first step of the project, retrieving query results from Google, really easy:

#!/usr/bin/perl -w
use strict;
use SOAP::Lite;
my $googleSearch = SOAP::Lite->service('file:GoogleSearch.wsdl');
my $key = '00000000000000000000000000000000';
my $query = 'exploring XML';
$ENV{HTTP_proxy} = 'http://proxy:3128';
my $result = $googleSearch->doGoogleSearch($key, $query, 0, 10, 'false', '', 'false', '', 'latin1', 'latin1');

We simply need to include the SOAP::Lite package and point it at the WSDL file included in the download from Google. From then on we can call all the functions defined in the service description, passing the right parameters. Google decided to make this service available for free in the beta phase, but requires everybody to register at their site and obtain a key that allows them to track your requests. This key needs to be passed along with the main function parameter, the actual query string.

Since the default transport for SOAP is HTTP, we might have to set the HTTP proxy in the environment if one is in the way. Then we are prepared to call the doGoogleSearch function which is automagically created for us by the service call on the WSDL file. The subsequent arguments to the function call deal with less important parameters.

More search parameters...


Produced by Michael Claßen


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
Intel PDF: Virtualization Delivers Data Center Efficiency
Intel eBook: Managing the Evolving Data Center
Microsoft Article: BitLocker Brings Encryption to Windows Server 2008
Symantec eBook: The Guide to E-Mail Archiving and Management
Microsoft Article: RODCs Transform Branch Office Security
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
Avaya Article: Advancing the State of the Art in Customer Service
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Avaya Article: Avaya AE Services Provide Rapid Telephony Integration with Facebook
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Seminar: Efficiencies in Hardware/Software Virtualization
HP Webcast: Disaster Recovery Planning
Go Parallel Video: Performance and Threading Tools for Game Developers
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
IBM TCO eKIT: Your IT Budget is Under Attack, Get in Control
IBM Energy Efficiency eKIT: Learn How to Reduce Costs
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Microsoft Article: Silverlight Streaming--Free Video Hosting for All
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
HP Demo: StorageWorks EVA4400
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
The Partial Function Application in JavaScript · Creating Dynamic RSS Feeds with Ajax · Performance Optimizations for High Speed JavaScript
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 30 - Distributed Service Broker Environment - Endpoints · Google Chrome: A Shiny New Salvo in the Browser War · eBiz News: Google Streamlines Feeds to Product Search

URL: http://www.webreference.com/xml/column55/index.html
Created: Apr 29, 2002
Revised: Apr 29, 2002