Book Image

PHP Web 2.0 Mashup Projects: Practical PHP Mashups with Google Maps, Flickr, Amazon, YouTube, MSN Search, Yahoo!

By : Shu-Wai Chow
Book Image

PHP Web 2.0 Mashup Projects: Practical PHP Mashups with Google Maps, Flickr, Amazon, YouTube, MSN Search, Yahoo!

By: Shu-Wai Chow

Overview of this book

A mashup is a web page or application that combines data from two or more external online sources into an integrated experience. This book is your entryway to the world of mashups and Web 2.0. You will create PHP projects that grab data from one place on the Web, mix it up with relevant information from another place on the Web and present it in a single application. This book is made up of five real-world PHP projects. Each project begins with an overview of the technologies and protocols needed for the project, and then dives straight into the tools used and details of creating the project: Look up products on Amazon.Com from their code in the Internet UPC database A fully customized search engine with MSN Search and Yahoo! A personal video jukebox with YouTube and Last.FM Deliver real-time traffic incident data via SMS and the California Highway Patrol! Display pictures sourced from Flickr in Google maps All the mashup applications used in the book are built upon free tools and are thoroughly explained. You will find all the source code used to build the mashups used in this book in the code download section for this book.
Table of Contents (11 chapters)

Mashing Up


We now have some key bits of information about this page. Let’s recap what we have discovered and learned:

  1. 1. 411Sync.com parses an RSS file on your server and passes it to the user. The service can take a variable from the user and pass to your page.

  2. 2. The page of incidents is at http://cad.chp.ca.gov/body.asp?centerin=XXCC, where “XXCC” is a four character code that defines the area to pull.

  3. 3. The incidents are in the second table of that page.

  4. 4. The columns of the incidents are always in the order ID Number, type, location, and general area.

  5. 5. Each incident cell has a class attribute whose value is T.

Based on these factors, the format needs of 411Sync.com, and user-friendliness for mobile users, we are going to break down our application into the following components:

  • clsIncident.php—An incident object, this is our “Model” component. All this class will do is hold information about an incident—time, location, etc.

  • clsDomParser.php—We are going to take a page from our event-based...