W Eb 2.0 Mashups
Total Page:16
File Type:pdf, Size:1020Kb
CYAN YELLOW MAGENTA BLACK PANTONE 123 C BOOKS FOR PROFESSIONALS BY PROFESSIONALS® THE EXPERT’S VOICE® IN WEB DEVELOPMENT Companion eBook Available Pro Web 2.0 Mashups: Remixing Data and Web Services Pro Dear Reader, Web 2.0 Mashups Web The Web contains thousands of mashups that recombine everything including Pro Google Maps, Flickr, Amazon.com, NASA, the New York Times, and Wikipedia with useful information about travel, finance, real estate, and more. By fusing elements from multiple web sites, mashups are often informative, useful, fun, and even transformative. Mashups also represent the way the Web as a whole is heading. By reading this book and working through the examples, you will learn how to create your own mashups; how to exploit such web elements as URLs, tags, and RSS feeds in your mashups; and how to combine APIs and data into mashups. Web 2.0 All you need to make full use of this book is basic knowledge of HTML, CSS, and JavaScript, and at least one server-side language (such as PHP, ASP.NET, or Python). By the time you’re finished, you will be able to take almost any source of data on the Web and mash it up with another to create unique and exciting sites of your own. This book draws from my experiences teaching graduate students and high- school students how to create mashups. I describe techniques to analyze and dissect existing mashups so that you can start from first principles, gaining the Mashups skills you need to write your own. Believe me, once you start creating mashups and seeing what you can do with them, you won’t want to stop. Raymond Yee Remixing Data and Web Services THE APRESS ROADMAP Building Flickr Applications with PHP Accelerated DOM Scripting Companion eBook Beginning with Ajax, APIs, and Libraries Remix the Web to create cutting-edge web applications Google Maps Applications Pro JavaScript Design Patterns with PHP and Ajax Pro Web 2.0 Application Beginning HTML with CSS Development with GWT Practical and XHTML: Modern JavaScript, DOM Scripting, Guide and Reference Pro Web 2.0 Mashups: and Ajax Projects See last page for details Remixing Data on $10 eBook version Beginning and Web Services Google Maps Applications with Rails and Ajax SOURCE CODE ONLINE ISBN-13: 978-1-59059-858-0 ISBN-10: 1-59059-858-X Raymond Yee www.apress.com Yee 5 4 9 9 9 US $49.99 Shelve in Web development User level: 9 781590 598580 Intermediate–Advanced this print for content only—size & color not accurate spine = 1.205" 640 page count 858Xch00FM.qxd 2/4/08 2:45 PM Page i Pro Web 2.0 Mashups Remixing Data and Web Services Raymond Yee 858Xch00FM.qxd 2/4/08 2:45 PM Page ii Pro Web 2.0 Mashups: Remixing Data and Web Services Copyright © 2008 by Raymond Yee Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution–NonCommercial-ShareAlike–2.5 License. Apress (http://www.apress.com/) and the author ask for your support by buying the print or eBook edition through any online or retail outlet. A copy of the license is included in the section entitled “Creative Commons Legal Code.” All rights reserved subject to the provisions of the Creative Commons License. ISBN-13 (pbk): 978-1-59059-858-0 ISBN-10 (pbk): 1-59059-858-X ISBN-13 (electronic): 978-1-4302-0286-8 ISBN-10 (electronic): 1-4302-0286-6 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Matthew Moodie Technical Reviewer: John Watson Editorial Board: Clay Andres, Steve Anglin, Ewan Buckingham, Tony Campbell, Gary Cornell, Jonathan Gennick, Kevin Goff, Matthew Moodie, Joseph Ottinger, Jeffrey Pepper, Frank Pohlmann, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Project Manager: Richard Dal Porto Copy Editor: Kim Wimpsett Associate Production Director: Kari Brooks-Copony Production Editors: Laura Esterman, Lori Bring Compositor: Kinetic Publishing Service, LLC Proofreader: Liz Welch Indexer: Broccoli Information Management Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected], or visit http://www.springeronline.com. For information on translations, please contact Apress directly at 2855 Telegraph Avenue, Suite 600, Berkeley, CA 94705. Phone 510-549-5930, fax 510-549-5939, e-mail [email protected], or visit http://www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at http://www.apress.com. You may need to answer questions pertaining to this book in order to successfully download the code. 858Xch00FM.qxd 2/4/08 2:45 PM Page iii For Laura, the love of my life 858Xch00FM.qxd 2/4/08 2:45 PM Page iv Contents at a Glance About the Author . xxi About the Technical Reviewer . xxiii Acknowledgments . xxv Introduction . xxvii PART 1 ■ ■ ■ Remixing Information Without Programming ■CHAPTER 1 Learning from Specific Mashups . 3 ■CHAPTER 2 Uncovering the Mashup Potential of Web Sites . 21 ■CHAPTER 3 Understanding Tagging and Folksonomies . 61 ■CHAPTER 4 Working with Feeds, RSS, and Atom . 77 ■CHAPTER 5 Integrating with Blogs . 105 PART 2 ■ ■ ■ Remixing a Single Web Application Using Its API ■CHAPTER 6 Learning Web Services APIs Through Flickr . 121 ■CHAPTER 7 Exploring Other Web APIs . 171 ■CHAPTER 8 Learning Ajax/JavaScript Widgets and Their APIs . 205 PART 3 ■ ■ ■ Making Mashups ■CHAPTER 9 Moving from APIs and Remixable Elements to Mashups. 227 ■CHAPTER 10 Creating Mashups of Several Services . 243 ■CHAPTER 11 Using Tools to Create Mashups. 283 ■CHAPTER 12 Making Your Web Site Mashable . 313 iv 858Xch00FM.qxd 2/4/08 2:45 PM Page v PART 4 ■ ■ ■ Exploring Other Mashup Topics ■CHAPTER 13 Remixing Online Maps and 3D Digital Globes . 327 ■CHAPTER 14 Exploring Social Bookmarking and Bibliographic Systems . 395 ■CHAPTER 15 Accessing Online Calendars and Event Aggregators. 417 ■CHAPTER 16 Using Online Storage Services . 473 ■CHAPTER 17 Mashing Up Desktop and Web-Based Office Suites . 487 ■CHAPTER 18 Using Microformats and RDFa As Embeddable Data Formats . 537 ■CHAPTER 19 Integrating Search . 559 ■APPENDIX . 573 ■INDEX . 579 858Xch00FM.qxd 2/4/08 2:45 PM Page vi 858Xch00FM.qxd 2/4/08 2:45 PM Page vii Contents About the Author . xxi About the Technical Reviewer . xxiii Acknowledgments . xxv Introduction . xxvii PART 1 ■ ■ ■ Remixing Information Without Programming ■CHAPTER 1 Learning from Specific Mashups . 3 Looking for Patterns in Mashups . 3 Housingmaps.com. 5 What Is Being Combined? . 5 Why Are the Constituent Elements Being Combined? What’s the Problem Being Solved? . 5 Where Is the Remixing Happening? . 6 How Are These Elements Being Combined? . 6 Comparable Mashups . 7 Google Maps in Flickr . 7 What Is Being Combined? . 8 Why Are the Constituent Elements Being Combined? What’s the Problem Being Solved? . 8 How Are These Elements Being Combined? . 12 Comparable Mashups . 13 LibraryLookup Bookmarklet. 13 Configuring a LibraryLookup Bookmarklet . 14 Invoking the LibraryLookup Bookmarklet . 15 How Does This Mashup Work? . 16 How Can This Mashup Be Extended?. 17 Comparable Mashups . 18 Tracking Other Mashups . 18 Summary . 18 vii 858Xch00FM.qxd 2/4/08 2:45 PM Page viii viii ■CONTENTS ■CHAPTER 2 Uncovering the Mashup Potential of Web Sites . 21 What Makes Web Sites and Applications Mashable . 22 Ascertaining the Fundamental Entities of the Web Site. 22 Public APIs and Existing Mashups . 23 Use of Ajax . 24 Embedded Scriptability. 24 Browser Plug-Ins . 25 Getting Data In and Out of the Web Site . 25 The Community of Users and Developers . 25 Mobile and Alternative Interfaces and the Skinnability of the Web Site . 26 Documentation. 26 Is the Web Site Run on Open Source? . 26 Intellectual Property, Reusability, and Creative Commons . 26 Tagging, Feeds, and Weblogging. ..