File: Zend_Feed-ConsumingAtom.xml

package info (click to toggle)
zendframework 1.12.9%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 133,584 kB
  • sloc: xml: 1,311,829; php: 570,173; sh: 170; makefile: 125; sql: 121
file content (141 lines) | stat: -rw-r--r-- 4,845 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?xml version="1.0" encoding="UTF-8"?>
<!-- Reviewed: no -->
<sect1 id="zend.feed.consuming-atom">
    <title>Consuming an Atom Feed</title>

    <para>
        <classname>Zend_Feed_Atom</classname> is used in much the same way as
        <classname>Zend_Feed_Rss</classname>. 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 <acronym>RSS</acronym>; it is more generalized
        protocol and it is designed to deal more easily with feeds that provide their full content
        inside the feed, splitting <acronym>RSS</acronym>' <property>description</property> tag into
        two elements, <property>summary</property> and <property>content</property>, for that
        purpose.
    </para>

    <example id="zend.feed.consuming-atom.example.usage">
        <title>Basic Use of an Atom Feed</title>

        <para>
            Read an Atom feed and print the <property>title</property> and
            <property>summary</property> of each entry:
        </para>

        <programlisting language="php"><![CDATA[
$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";
}
]]></programlisting>
    </example>

    <para>
        In an Atom feed you can expect to find the following feed properties:
    </para>

    <itemizedlist>
        <listitem>
            <para>
                <property>title</property> - The feed's title, same as <acronym>RSS</acronym>'s
                 channel title
            </para>
        </listitem>

        <listitem>
            <para>
                <property>id</property> - Every feed and entry in Atom has a unique identifier
            </para>
        </listitem>

        <listitem>
            <para>
                <property>link</property> - Feeds can have multiple links, which are
                distinguished by a <property>type</property> attribute
            </para>

            <para>
                The equivalent to <acronym>RSS</acronym>'s channel link would be
                <command>type="text/html"</command>. if the link is to an alternate version of
                the same content that's in the feed, it would have a
                <command>rel="alternate"</command> attribute.
            </para>
        </listitem>

        <listitem>
            <para>
                <property>subtitle</property> - The feed's description, equivalent to
                <acronym>RSS</acronym>' channel description
            </para>

            <para><property>author->name()</property> - The feed author's name</para>
            <para><property>author->email()</property> - The feed author's email address</para>
        </listitem>
    </itemizedlist>

    <para>
        Atom entries commonly have the following properties:
    </para>

    <itemizedlist>
        <listitem>
            <para><property>id</property> - The entry's unique identifier</para>
        </listitem>

        <listitem>
            <para>
                <property>title</property> - The entry's title, same as <acronym>RSS</acronym>
                item titles
            </para>
        </listitem>

        <listitem>
            <para>
                <property>link</property> - A link to another format or an alternate view of
                this entry
            </para>
        </listitem>

        <listitem>
            <para><property>summary</property> - A summary of this entry's content</para>
        </listitem>

        <listitem>
            <para>
                <property>content</property> - The full content of the entry; can be skipped if
                the feed just contains summaries
            </para>
        </listitem>

        <listitem>
            <para>
                <property>author</property> - with <property>name</property> and
                <property>email</property> sub-tags like feeds have
            </para>
        </listitem>

        <listitem>
            <para>
                <property>published</property> - the date the entry was published, in
                <acronym>RFC</acronym> 3339 format
            </para>
        </listitem>

        <listitem>
            <para>
                <property>updated</property> - the date the entry was last updated, in
                <acronym>RFC</acronym> 3339 format
            </para>
        </listitem>
    </itemizedlist>

    <para>
        For more information on Atom and plenty of resources, see
        <ulink url="http://www.atomenabled.org/">http://www.atomenabled.org/</ulink>.
    </para>
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->