Part III. Making Mashups

Part 3 is the heart of the book. The previous chapters explained how to work with individual APIs and widgets, which are the raw materials of mashups. In this part, Chapter 9 talks about mashups in general and their relationship to APIs; the primary technique shown is to use ProgrammableWeb to learn about mashups. Chapter 10 covers the ­nitty-­gritty of creating a mashup—using a specific example of mashing up Flickr and Google Maps. In Chapter 11, we’ll study the tools that help you create mashups, while in Chapter 12, we’ll look at the subject of mashup making from the point of view of API creators.

Table of Contents

9. Moving from APIs and Remixable Elements to Mashups
Getting Oriented to ProgrammableWeb
User-Generated Data in ProgrammableWeb
Can Any Directory of Mashups Keep Up?
Learning About the Overall Mashup Scene
Directory of Mashups
Using Feeds to Track Mashups
Using Tags to Describe Mashups
API and Mashup Verticals
Looking at a Specific Mashup Profile
Going from a Specific API to Mashups
Sample Problems to Solve Using Mashups
Tracking Interesting Books
Knowing When to Buy Airplane Tickets
Finding That Dream House
Mapping Breaking News
10. Creating Mashups of Several Services
The Design
Background: Geotagging in Flickr
Background: XMLHttpRequest and Containing Libraries
Using XMLHttpRequest Directly
Using the YUI Connection Manager
Building a Server-­Side Proxy
What Happens with XHR and Direct API Calls?
Building a Server-­Side Script for Geolocated Photos
Building a Simple Client-­Side Frame
Reading and Writing Elements
Handling Simple Events to Connect Form Input and Display Calculations
Hooking the Client-­Side Framework to Flickr
Writing a URL for Querying flickrgeo.php
Using XHR via the YUI Connection Manager to Read the JSON
Converting the JSON to HTML
Mashing Up Google Maps API with Flickr
Setting Up a Basic Google Map
Making the Map Respond to Changes in the Viewport of the Map
Bringing Together the Flickr and GMap Code
Wiring Up the Bounding Box of the Google Map
Making the Pictures Show Up in the Map
Google Mapplet That Shows Flickr Photos
11. Using Tools to Create Mashups
The Problem Mashup Tools Solve
What You Are Making in This Chapter
Making the Mashup: A ­Step-­by-Step Example
Familiarizing Yourself with the Google Mashup Editor
Reading and Displaying a Feed (Simple Template)
Introducing a Custom Template
Using Yahoo! Pipes to Access Flickr
Displaying Flickr Photos Using <gm:map>
Adding JavaScript to the Mashup
How to Persist Feeds and Use Tabs
The Final Product: Showing the Saved Entries on a Map
Analysis of ­Trade-­Offs in Using GME and Yahoo! Pipes
Other Mashup Tools
12. Making Your Web Site Mashable
Why Make Your Web Site Mashable?
Using Techniques That Do Not Depend on APIs
Use a Consistent and Rich URL Language
Use W3C Standards to Develop Your Web Site
Pay Attention to Web Accessibility
Consider Allowing Users to Tag Your Content
Make Feeds Available
Make It Easy to Post Your Content to Blogs and Other Web Sites
Encourage the Sharing of Content with Explicit Licenses
Develop Extensive Import and Export Options for User Content
Study How Users Remix Your Content and Make It Easier to Do So
Creating a ­Mashup-­Friendly API
Learn From and Emulate Other APIs
Keep in Mind Your Audiences for the API
Make Your API Easy to Learn
Test the Usability of Your API
Build a Granular, Loosely Coupled Architecture So That Creating an API Serves You As Much As It Does Others
Embrace REST But Also Support SOAP and ­XML-­RPC If You Can
Consider Using the Atom Publishing Protocol As a Specific Instantiation of REST
Encourage the Development of API Kits: Third Party or ­In-­House
Support Extensive Error Reporting in Your APIs
Accept Multiple Formats for Output and Input
Support UI Functionality in the API
Include a Search API for Your Own Site
Version Your API
Foster a Community of Developers
Don’t Try to Be Too Controlling in Your API
Consider Producing a ­Service-­Level Agreement (SLA)
Help API Users Consume Your Resources Wisely
Consider Open Sourcing Your Application
Easy-to-Understand Data Standards