tags: apache   archive   business   charity   climbing   comic   communication   database   email   exchange   family   fm2008   hack   hardware   humour   linux   liverpool   microsoft   money   mysql   network   oes   opensource   outlook   php   pictures   process   project   quote   real_life   review   rss   science   security   software   thought   tsm   updates   webdev   website   windows  

PHP Web 2.0 Mashup Projects Review

Fri, 18 Jan 2008 12:59:44

What I love about PHP Web 2.0 Mashup Projects by Shu-Wai Chow is that it offers real world examples. You can download the code used in the book from Packt Publishing’s support page and use that as your starting point. We’re shown how to use various API’s provided by developers such as Amazon and Yahoo to mix services together and provide a new hybrid web application. An example is using google maps to display Wii console availability on launch day from stores nationwide. I’ve a couple years experience with PHP and a lot of the technologies and protocols were new to me. What I enjoyed was the introduction to each protocol such as XML-RPC and REST, you’re not flooded with information but provided with enough to work through the chapter.

At the beginning of each chapter we’re told what protocols and APIs will be used and a brief overview of the objective. This allows you to quickly refer to sections in the book if you’re working on a project and would like to refresh your understanding. Six chapters in all which grow in complexity and challenge you to use your new found skills and code. We begin with an introduction to mashups, what they are and how they can be used. Chapter two we are shown how to create, for some of us, our first mashup using the amazon API. Exploring PHP’s SAX function we create a parser for XML and create a front end to the amazon store allowing users to order directly through our site. You could customise this page to look as if your organisation sold the products directly which then hands the transaction over to Amazon to process the order. There’s no tip toeing around as you’re expected to have good experience with PHP and get stuck into data manipulation from the start.

Chapter three looks at creating a search engine using MSN and Yahoo’s API. Here we are introduced to SOAP, which is the most complex web service used today. There are 17 pages alone detailing SOAPs structure and it’s easy to feel lost. If like me, you’ve not worked with the SOAP protocol before you may need to re-read a few pages before you feel confident enough to continue. We’re then introduced to PHP’s SoapClient which is a welcomed relief as it automates much of the low level processes allowing you to concentrate on the data. The result is a mashup which searches both MSN and Yahoo and presents the results to your customised page.

Chapter four and we’re working with You Tube’s API and an RSS feed from Last.fm. With XML, XPSF and RSS we query a user’s playlist from Last.fm and display the You Tube related video. For me this was the easiest chapter as we work with data feeds you are familiar with and use PEAR to help with parsing. Chapter five is very interesting and data is gathered in a completely new way. It’s time to take a look at screen scraping. Using PHP’s DOM protocol we deconstruct the California Highway Patrol website and send the information via SMS. I was surprised how easy it was to screen scrape data from a site and pass it to an RSS formatted page. We begin by looking at an example of how DOM parses the results which helps with understanding. Then it’s over to the Californian Highway page to scrape off the required data.

Chapter six is the largest and most complex chapter in the book. Focusing on numerous data formats and tools such as SPAEQL, API for PHP and XMLHttpRequst Object (AJAX) we mash up Google maps and pictures from Flickr. Due to the number of technologies used and advanced techniques Shu-Wai Chow takes us from preliminary planning through to summary providing as much detail as possible without leaving you exhausted. Each new technology is introduced with a simple query allowing you to understand them as individual components before we create our final mashup.

PHP Web 2.0 Mashup Projects is written well and in a way that even for someone like myself, who only has a couple of years working experience, easy to pick up and get stuck in. If you’re new to the protocols and technologies you may initially feel overwhelmed, I found using the sample code and continuing to work through the chapters I naturally became more confident. Shu-Wai Chow does an excellent job explaining the principals behind the technology, so although I did not always understand the specific elements, I had enough information to complete each chapter. All in all I recommend this book to anyone who has interest in mashing up various online services and even to those who’d just like a better understanding on how such technologies work.

You can buy PHP Web 2.0 Mashup Projects directly from the publisher here

Enjoy
Ryan Partington

php
Visit site