4.5. Consuming an Atom Feed

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.

Exemplo 4.2. Basic Use of an Atom Feed

Read an Atom feed and print the title and summary of each entry:

<?php

$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:

Atom entries commonly have the following properties:

For more information on Atom and plenty of resources, see http://www.atomenabled.org/.