[MANUAL] English:
[zend.git] / documentation / manual / en / module_specs / Zend_Feed-ConsumingAtom.xml
blob441ca4df603ed06af01a501f471f3f67a655d22e
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <sect1 id="zend.feed.consuming-atom">
4     <title>Consuming an Atom Feed</title>
6     <para>
7         <classname>Zend_Feed_Atom</classname> is used in much the same way as
8         <classname>Zend_Feed_Rss</classname>. It provides the same access to feed-level properties
9         and iteration over entries in the feed. The main difference is in the structure of the Atom
10         protocol itself. Atom is a successor to <acronym>RSS</acronym>; it is more generalized
11         protocol and it is designed to deal more easily with feeds that provide their full content
12         inside the feed, splitting <acronym>RSS</acronym>' <property>description</property> tag into
13         two elements, <property>summary</property> and <property>content</property>, for that
14         purpose.
15     </para>
17     <example id="zend.feed.consuming-atom.example.usage">
18         <title>Basic Use of an Atom Feed</title>
20         <para>
21             Read an Atom feed and print the <property>title</property> and
22             <property>summary</property> of each entry:
23         </para>
25         <programlisting language="php"><![CDATA[
26 $feed = new Zend_Feed_Atom('http://atom.example.com/feed/');
27 echo 'The feed contains ' . $feed->count() . ' entries.' . "\n\n";
28 foreach ($feed as $entry) {
29     echo 'Title: ' . $entry->title() . "\n";
30     echo 'Summary: ' . $entry->summary() . "\n\n";
32 ]]></programlisting>
33     </example>
35     <para>
36         In an Atom feed you can expect to find the following feed properties:
37     </para>
39     <itemizedlist>
40         <listitem>
41             <para>
42                 <property>title</property> - The feed's title, same as <acronym>RSS</acronym>'s
43                  channel title
44             </para>
45         </listitem>
47         <listitem>
48             <para>
49                 <property>id</property> - Every feed and entry in Atom has a unique identifier
50             </para>
51         </listitem>
53         <listitem>
54             <para>
55                 <property>link</property> - Feeds can have multiple links, which are
56                 distinguished by a <property>type</property> attribute
57             </para>
59             <para>
60                 The equivalent to <acronym>RSS</acronym>'s channel link would be
61                 <command>type="text/html"</command>. if the link is to an alternate version of
62                 the same content that's in the feed, it would have a
63                 <command>rel="alternate"</command> attribute.
64             </para>
65         </listitem>
67         <listitem>
68             <para>
69                 <property>subtitle</property> - The feed's description, equivalent to
70                 <acronym>RSS</acronym>' channel description
71             </para>
73             <para><property>author->name()</property> - The feed author's name</para>
74             <para><property>author->email()</property> - The feed author's email address</para>
75         </listitem>
76     </itemizedlist>
78     <para>
79         Atom entries commonly have the following properties:
80     </para>
82     <itemizedlist>
83         <listitem>
84             <para><property>id</property> - The entry's unique identifier</para>
85         </listitem>
87         <listitem>
88             <para>
89                 <property>title</property> - The entry's title, same as <acronym>RSS</acronym>
90                 item titles
91             </para>
92         </listitem>
94         <listitem>
95             <para>
96                 <property>link</property> - A link to another format or an alternate view of
97                 this entry
98             </para>
99         </listitem>
101         <listitem>
102             <para><property>summary</property> - A summary of this entry's content</para>
103         </listitem>
105         <listitem>
106             <para>
107                 <property>content</property> - The full content of the entry; can be skipped if
108                 the feed just contains summaries
109             </para>
110         </listitem>
112         <listitem>
113             <para>
114                 <property>author</property> - with <property>name</property> and
115                 <property>email</property> sub-tags like feeds have
116             </para>
117         </listitem>
119         <listitem>
120             <para>
121                 <property>published</property> - the date the entry was published, in
122                 <acronym>RFC</acronym> 3339 format
123             </para>
124         </listitem>
126         <listitem>
127             <para>
128                 <property>updated</property> - the date the entry was last updated, in
129                 <acronym>RFC</acronym> 3339 format
130             </para>
131         </listitem>
132     </itemizedlist>
134     <para>
135         For more information on Atom and plenty of resources, see
136         <ulink url="http://www.atomenabled.org/">http://www.atomenabled.org/</ulink>.
137     </para>
138 </sect1>
139 <!--
140 vim:se ts=4 sw=4 et: