annotate vendor/zendframework/zend-feed/doc/book/consuming-atom-entry.md @ 0:4c8ae668cc8c
Initial import (non-working)
author |
Chris Cannam |
date |
Wed, 29 Nov 2017 16:09:58 +0000 |
parents |
|
children |
|
rev |
line source |
Chris@0
|
1 # Consuming a Single Atom Entry
|
Chris@0
|
2
|
Chris@0
|
3 Single Atom `<entry>` elements are also valid by themselves. Usually the URL for
|
Chris@0
|
4 an entry is the feed's URL followed by `/<entryId>`, such as
|
Chris@0
|
5 `http://atom.example.com/feed/1`, using the example URL we used above. This
|
Chris@0
|
6 pattern may exist for some web services which use Atom as a container syntax.
|
Chris@0
|
7
|
Chris@0
|
8 If you read a single entry, you will have a `Zend\Feed\Reader\Entry\Atom` object.
|
Chris@0
|
9
|
Chris@0
|
10 ## Reading a Single-Entry Atom Feed
|
Chris@0
|
11
|
Chris@0
|
12 ```php
|
Chris@0
|
13 $entry = Zend\Feed\Reader\Reader::import('http://atom.example.com/feed/1');
|
Chris@0
|
14 echo 'Entry title: ' . $entry->getTitle();
|
Chris@0
|
15 ```
|
Chris@0
|
16
|
Chris@0
|
17 > ## Importing requires an HTTP client
|
Chris@0
|
18 >
|
Chris@0
|
19 > To import a feed, you will need to have an [HTTP client](zend.feed.http-clients)
|
Chris@0
|
20 > available.
|
Chris@0
|
21 >
|
Chris@0
|
22 > If you are not using zend-http, you will need to inject `Reader` with the HTTP
|
Chris@0
|
23 > client. See the [section on providing a client to Reader](http-clients.md#providing-a-client-to-reader).
|