For our first real-time data source, we'll use the excellent Nextbus API. Nextbus.com is a commercial service that tracks public transportation for municipalities including buses, trolleys, and trains. People riding these transit lines can then track the arrival time of the "next bus". What's even better is, with the customer's permission, Nextbus publishes tracking data through a Representational State Transfer or REST API. Using URL API calls developers can request information about a vehicle and receive an XML document about its location. This API is a straightforward way to begin using real-time data.
If you go to Nextbus.com, there is a web interface to the data as well, as shown in the following screenshot, of the city of Thunder Bay transit system in Ontario, Canada:
The system lets you select several parameters to learn the current location and time prediction for the next stop. On the right side of the screen is a link to a Google Maps mash-up showing the transit...