Mining Google Web Services: Building Applications with the Google API John Paul Mueller SYBEX® 4333c00.qxd 3/31/04 9:17 PM Page i (cid:1) Mining Google Web Services: Building Applications with the Google API This page intentionally left blank 4333c00.qxd 4/2/04 4:50 PM Page iii John Paul Mueller (cid:1) Mining Google Web Services: Building Applications with the Google API Sybex San Francisco • London 4333c00.qxd 3/31/04 9:17 PM Page iv Associate Publisher: Joel Fugazzotto Acquisitions and Developmental Editor: Tom Cirtin Production Editor: Leslie E.H. Light Technical Editor: Russ Mullen Copyeditor: Cheryl Hauser Compositor: Happenstance Type-O-Rama Graphic Illustrator: Happenstance Type-O-Rama Proofreaders: Laurie O’Connell, Nancy Riddiough Indexer: Lynnzee Elze Cover Design and Illustration: Richard Miller, Calyx Design Copyright © 2004 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic, or other record, without the prior agreement and written permission of the publisher. Library of Congress Card Number: 2003116218 ISBN: 0-7821-4333-4 SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the United States and/or other countries. Screen reproductions produced with PaintShop Pro. PaintShop Pro is a trademark of Jasc Software, Inc. Internet screen shot(s) using Microsoft Internet Explorer reprinted by permission from Microsoft Corporation. Openwave and the Openwave logo are trademarks of Openwave Systems Inc. All rights reserved. Google and the Google logo are trademarks of Google Inc. Screenshots are copyrighted by Google Inc. and are reprinted by permission. TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following the capitalization style used by the manufacturer. The author and publisher have made their best efforts to prepare this book, and the content is based upon final release software whenever possible. Portions of the manuscript may be based upon pre-release versions supplied by software manufacturer(s). The author and the publisher make no representation or warranties of any kind with regard to the completeness or accuracy of the contents herein and accept no liability of any kind including but not limited to performance, merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or alleged to be caused directly or indirectly from this book. Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 4333c00.qxd 3/31/04 9:17 PM Page v SOFTWARE LICENSE AGREEMENT: TERMS Warranty AND CONDITIONS SYBEX warrants the enclosed media to be free of physical defects for a period of ninety (90) days after purchase. The Software is not The media and/or any online materials accompanying this book available from SYBEX in any other form or media than that that are available now or in the future contain programs and/or enclosed herein or posted to www.sybex.com. If you discover a text files (the “Software”) to be used in connection with the book. defect in the media during this warranty period, you may obtain a SYBEX hereby grants to you a license to use the Software, subject replacement of identical format at no charge by sending the defec- to the terms that follow. Your purchase, acceptance, or use of the tive media, postage prepaid, with proof of purchase to: Software will constitute your acceptance of such terms. The Software compilation is the property of SYBEX unless other- SYBEX Inc. wise indicated and is protected by copyright to SYBEX or other Product Support Department copyright owner(s) as indicated in the media files (the “Owner(s)”). 1151 Marina Village Parkway You are hereby granted a single-user license to use the Software Alameda, CA 94501 for your personal, noncommercial use only. You may not repro- Web: http://www.sybex.com duce, sell, distribute, publish, circulate, or commercially exploit the Software, or any portion thereof, without the written consent After the 90-day period, you can obtain replacement media of of SYBEX and the specific copyright owner(s) of any component identical format by sending us the defective disk, proof of pur- software included on this media. chase, and a check or money order for $10, payable to SYBEX. In the event that the Software or components include specific Disclaimer license requirements or end-user agreements, statements of condi- SYBEX makes no warranty or representation, either expressed or tion, disclaimers, limitations or warranties (“End-User License”), implied, with respect to the Software or its contents, quality, per- those End-User Licenses supersede the terms and conditions formance, merchantability, or fitness for a particular purpose. In herein as to that particular Software component. Your purchase, no event will SYBEX, its distributors, or dealers be liable to you or acceptance, or use of the Software will constitute your acceptance any other party for direct, indirect, special, incidental, consequen- of such End-User Licenses. tial, or other damages arising out of the use of or inability to use By purchase, use or acceptance of the Software you further agree the Software or its contents even if advised of the possibility of to comply with all export laws and regulations of the United States such damage. In the event that the Software includes an online as such laws and regulations may exist from time to time. update feature, SYBEX further disclaims any obligation to provide this feature for any specific duration other than the initial posting. Reusable Code in This Book The exclusion of implied warranties is not permitted by some The author(s) created reusable code in this publication expressly states. Therefore, the above exclusion may not apply to you. This for reuse by readers. Sybex grants readers limited permission to warranty provides you with specific legal rights; there may be reuse the code found in this publication, its accompanying CD- other rights that you may have that vary from state to state. The ROM or available for download from our website so long as the pricing of the book with the Software by SYBEX reflects the allo- author(s) are attributed in any application containing the reusable cation of risk and limitations on liability contained in this agree- code and the code itself is never distributed, posted online by elec- ment of Terms and Conditions. tronic transmission, sold, or commercially exploited as a stand- alone product. Shareware Distribution This Software may contain various programs that are distributed Software Support as shareware. Copyright laws apply to both shareware and ordi- Components of the supplemental Software and any offers associ- nary commercial software, and the copyright Owner(s) retains all ated with them may be supported by the specific Owner(s) of that rights. If you try a shareware program and continue using it, you material, but they are not supported by SYBEX. Information are expected to register it. Individual programs differ on details of regarding any available support may be obtained from the trial periods, registration, and payment. Please observe the Owner(s) using the information provided in the appropriate requirements stated in appropriate files. read.me files or listed elsewhere on the media. Should the manufacturer(s) or other Owner(s) cease to offer sup- Copy Protection port or decline to honor any offer, SYBEX bears no responsibility. The Software in whole or in part may or may not be copy-pro- This notice concerning support for the Software is provided for tected or encrypted. However, in all cases, reselling or redistribut- your information only. SYBEX is not the agent or principal of the ing these files without authorization is expressly forbidden except Owner(s), and SYBEX is in no way responsible for providing any as specifically provided for by the Owner(s) therein. support for the Software, nor is it liable or responsible for any sup- port provided, or not provided, by the Owner(s). This page intentionally left blank 4333c00.qxd 3/31/04 9:17 PM Page vii To Karen Watterson, a kindred spirit and fellow worker. 4333c00.qxd 3/31/04 9:17 PM Page viii Acknowledgments T hanks to my wife, Rebecca, for working with me to get this book completed. I really don’t know what I would have done without her help in researching and compiling some of the information that appears in this book. She also did a fine job of proofreading my rough draft and page proofing the result. Russ Mullen deserves thanks for his technical edit of this book. He greatly added to the accuracy and depth of the material you see here. Russ is always providing me with great URLs for new products and ideas. I also appreciated his hard work in testing endless versions of applications and providing input in my ideas. This book is technically challenging in that it relies on a number of programming languages, new and evolving technology, and several new products. Russ met the challenge with an efficiency that few other people could match. A number of people read all or part of this book to help me refine the approach and to test the examples on a number of systems. These unpaid volunteers helped in ways too numerous to mention here. I especially appreciate the efforts of Eva Beattie who read the entire book and selflessly devoted herself to this project. Phillipp Lenssen provided a lot of information about both Google Web Services and Amazon Web Services. He also provided the inspira- tion for the combined Google and Amazon application. Osvaldo Téllez Almirall provided extensive input on international issues, making the book much better suited to international needs as a result. David Clark helped with accessibility, user interface, and PHP development issues. Matt Wagner, my agent, deserves credit for helping me get the contract in the first place and taking care of all the details that most authors don’t really consider. I always appreciate his help. It’s good to know that someone wants to help. Finally, I would like to thank Tom Cirtin, Leslie Light, Cheryl Hauser, and the rest of the editorial and production staff at Sybex for their assistance in bringing this book to print. It’s always nice to work with such a great group of professionals and I very much appreciate the friendship we have built over the last two books. 4333c00.qxd 3/31/04 9:17 PM Page ix Contents at a Glance Introduction xvii Part I Discovering Google Web Services Chapter 1: Learning about Google Web Services 3 Chapter 2: Defining a Search 29 Chapter 3: Working with Web Service Data 47 Part II Writing Google Web Services Programs Chapter 4: Starting the Development Process 79 Chapter 5: Writing Applications Using VBA 103 Chapter 6: Writing Applications Using Visual Studio 133 Chapter 7: Writing Applications Using PHP 177 Chapter 8: Writing Applications Using Java 199 Chapter 9: Writing Applications for Mobile Devices 229 Part III Refining Your Google Web Services Program Chapter 10: Crafting Your Application 257 Chapter 11: Other Refinements You Should Consider 275 Appendixes Appendix A: Helpful Third Party Resource Sites 299 Appendix B: Google License Checklist 305 Appendix C: Late Breaking Google Web Services News 309 Glossary 313 Index 339
Description: