Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Understanding the Zend Framework, Part 8: Adding related information and services

Sean Kelly (skelly@idsociety.com), Web Application Developer, ID Society
Sean Kelly graduated with a degree in mathematics from Reed College. He is currently a Web application developer for ID Society, a full-service Internet marketing agency in New York City. He is a supporter of open source content management systems, and contributes to Joomla! and the Wikipedia project.

Summary:  In previous parts of this "Understanding the Zend Framework" series, you created the basic application, the Chomp online feed reader, using the open source PHP Zend Framework. This tutorial, the eighth part of the series, adds an extra dimension to your feed reader by linking the online resources of Amazon.com, Yahoo!, Twitter and Flickr with your current application to create a robust mashup.

View more content in this series

Date:  18 Jan 2011 (Published 29 Aug 2006)
Level:  Intermediate PDF:  A4 and Letter (288 KB | 28 pages)Get Adobe® Reader®

Activity:  21668 views
Comments:  

Before you start

This tutorial is for developers who want to learn about creating a simple mashup, a web application that uses information from different sources. It uses the Zend Framework's Zend_Services component and the principle of Representational State Transfer (REST) to demonstrate how to seamlessly include information to extra resources related to your feeds.

Using the examples of Amazon Web Services (AWS), Flickr Services, and Yahoo! Search Web services, and Twitter, this tutorial teaches you how to apply the PHP Zend Framework to quickly search those sites for relevant information. You will integrate this functionality into the Chomp feed reader developed in the previous parts of this series.

About this series

This series chronicles the building of an online feed reader, Chomp, while explaining all of the major aspects of using the recently introduced open source PHP Zend Framework.

Part 1 talked about the overall concepts of the Zend Framework, including a list of relevant classes and a general discussion of the MVC pattern. Part 2 expanded on that to show how MVC can be implemented in a Zend Framework application. You also created the user registration and login process, adding user information to the database and pulling it back out again.

Parts 3 and 4 deal with the actual RSS and Atom feeds. In Part 3, you enabled users to subscribe to individual feeds and to display the items listed in those feeds. You also learned about the Zend Framework's form-handling capabilities, validating data, and sanitizing feed items. Part 4 explained how to create a proxy to pull data from a site that has no feed.

The rest of the series involves adding value to the Chomp application. Part 5 explained how to use the Zend_PDF module to enable the user to create a customized PDF of saved articles, images, and search results. In Part 6, you used the Zend_Mail module to alert users to new posts. In Part 7, you looked at searching saved content and returning ranked results. Here in Part 8, you will add an extra dimension to your feed reader by linking the online resources of Amazon.com, Yahoo!, Twitter and Flickr with your current application to create a robust mashup. And in Part 9, you will add Ajax to streamline the application and improve usability.


About this tutorial

The process of providing links to related resources, or hyperlinking, is at the very core of the web. In fact, it is the very reason the web exists, and it's nothing new. However, what would previously need to be done by a human — searching the web for relevant resources, bookmarking URLs, and manually entering them into an article — can be easily automated when sites like Amazon and Yahoo! open up their sites using an application programming interface (API). APIs allow developers to access small snippets of information in a form other than a web page, most commonly with some type of XML. By automatically requesting a link to a book, you can dramatically increase the richness of your application without adding much overhead. Further, the Zend Framework's built-in APIs allows you to add relevant code in a few simple lines.

Like any good feed reader, Chomp provides the user with a collection of articles that are interesting. You can probably assume that if a feed mentions, say, a book related to a given article, the user would find that book interesting, as well. This tutorial seeks to give the user quick and easy access to this extra information by connecting directly to the Amazon.com developer's API and providing a link to the book on Amazon's site. Similarly, you can provide a link to a photo of an interesting location through Flickr, you can provide a link to Yahoo! news search results, or you could even search Twitter for the latest tweets.

This tutorial will cover:

  • GET, POST, REST -- Stateless vs. sessioned network interactions and how stateless interfaces can dramatically improve usability
  • A quick overview of the Amazon Web Services interface
  • Using the Zend Framework's Zend_Service_Amazon component to access Amazon
  • Yahoo! Developer Network -- using the searching websites, news, and local results
  • An overview of Flickr services, tagging, and using Zend_Service_Flickr to search photos
  • How to add Twitter results alongside the search results given when a feed search is performed
  • Integrating the Yahoo! Developer Network with Chomp using the Zend_Service_Yahoo component
  • Adding all of this information to the Chomp interface

Prerequisites

This tutorial assumes that you have a good familiarity with PHP programming. It would be helpful if you have a general familiarity with Amazon.com, Flickr, Twitter and Yahoo!, though you do not need to know much about these sites.


System requirements

To follow along, you will need to have several pieces of software installed. This tutorial will cover installation and configuration, but make sure to download the following pieces of software. For detailed installation instructions on installing XAMPP and the Zend Framework, see Part 2.

XAMPP
This is an easy-to-install version of Apache, MySQL, and PHP rolled into one package.
AWS Access Key
You need an Amazon Web Services access key.
Yahoo! Application ID
You need a Yahoo! Application ID, but first you need a Yahoo! username.

1 of 10 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=154287
TutorialTitle=Understanding the Zend Framework, Part 8: Adding related information and services
publish-date=01182011
author1-email=skelly@idsociety.com
author1-email-cc=