Programmer's Reference Guide
Zend_Feed_Atom is used in much the same way as Zend_Feed_Rss. It provides
the same access to feed-level properties and iteration over entries in the feed. The main
difference is in the structure of the Atom protocol itself. Atom is a successor to RSS; it is more
generalized protocol and it is designed to deal more easily with feeds that provide their full
content inside the feed, splitting RSS' description tag into two elements,
summary and content, for that purpose.
Example 18.2. Basic Use of an Atom Feed
Read an Atom feed and print the title and summary of each entry:
$feed = new Zend_Feed_Atom('http://atom.example.com/feed/');
echo 'The feed contains ' . $feed->count() . ' entries.' . "\n\n";
foreach ($feed as $entry) {
echo 'Title: ' . $entry->title() . "\n";
echo 'Summary: ' . $entry->summary() . "\n\n";
}
In an Atom feed you can expect to find the following feed properties:
title- The feed's title, same as RSS's channel titleid- Every feed and entry in Atom has a unique identifier-
link- Feeds can have multiple links, which are distinguished by atypeattributeThe equivalent to RSS's channel link would be
type="text/html". If the link is to an alternate version of the same content that's in the feed, it would have arel="alternate"attribute. -
subtitle- The feed's description, equivalent to RSS' channel descriptionauthor->name()- The feed author's nameauthor->email()- The feed author's email address
Atom entries commonly have the following properties:
id- The entry's unique identifiertitle- The entry's title, same as RSS item titleslink- A link to another format or an alternate view of this entrysummary- A summary of this entry's contentcontent- The full content of the entry; can be skipped if the feed just contains summariesauthor- withnameandemailsub-tags like feeds havepublished- the date the entry was published, in RFC 3339 formatupdated- the date the entry was last updated, in RFC 3339 format
For more information on Atom and plenty of resources, see http://www.atomenabled.org/.
Search the Manual
Components
Languages Available
Translation Status Reports
View the current status report of Zend Framework manual translations.
