ICT336 title
Murdoch University logo

Laboratory Week 12 - Google Web API


Learning Objectives:

  1. Learn to use WSDL to indentify and invoke a SOAP service.
  2. Learn to invoke and make use of an available live online Web Service.

Required Reading:

Lectures: Week 10 and 11.

Access to Software:

All required software is available on gryphon.murdoch.edu.au. External students may download the required Perl module SOAP::Lite and install it on your own machine.

Instructions:

  1. The following instructions make use of files and scripts available in the unit coordinator's directory (~hiew/examples/googleapi/) on gryphon. Use the command "cp" to copy the file over to your work directory on gryphon. Eg.

    gryphon:~> mkdir ~/labwk12
    gryphon:~> cp ~hiew/examples/googleapi/* ~/labwk12

  2. Go to the Google Web API page and click on "Create a Google Account". Follow the instructions to create yourself an account and get a key to use the Google Web Service.

  3. Edit the googlesearch.pl script. Replace the string '0xx0' in line 11 with the key you obtained from step (2).

  4. The googlesearch.pl script uses the google search engine to retrieve some results for a keyword search. Try the script by supplying two parameters: the first is the query keyword, and the second is the number of results to return. Eg.

    perl googlesearch.pl Internet 5
    perl googlesearch.pl "XML Resources" 3

  5. Look at the GoogleSearch.wsdl file. Find the equivalent elements in that file that is used in the googlesearch.pl script (eg. estimatedTotalResultsCount and URL in resultElements).

Exercises:

  1. Use googlesearch.pl to retrieve the top 5 results for a search on the keyword 'SOAP'.

  2. Modify the googlesearch.pl script so that it shows the following

    1. The original search query string received by the service.

    2. The title of the URL's retrieved.

    3. Any relevant Google Directory titles of the retrieved results.

  3. What is the difference between using WSDL as we are doing with this week's exercises, and not using the WSDL as we did in week 11's lab? Is there any advantage to having the WSDL document?

  4. Consider the approach used in this lab of getting Google search results. What are the advantages as a software developer compared to the ways of using Google you are familiar with before?

  5. Consider the approach used in this lab of supplying the Google search facility (ie. think of yourself as developing for the Google search engine). What are the advantages as a software developer compared to the ways of supplying Google search you are familiar with before?

Assessable Tasks:

Exercises 1-3.

Internal students should demonstrate to your tutor by executing your scripts with your tutor present. This must be done in weeks 12 or 13.

External students should submit the scripts and sample runs during the deadline as indicated in the Study Schedule.

H.L. Hiew
Unit Coordinator


Document author: H.L. Hiew, Unit Coordinator
Last Modified: Wednesday, 12-May-2004 19:47:26 MST
Disclaimer & Copyright Notice © 2004 Murdoch University
This document is relevant for semester 1, 2004 only