10.3. Retrieving Feeds from Web Pages
上一页 | 第 10 章 Zend_Feed | 下一页

## 10.3. Retrieving Feeds from Web Pages

Web pages often contain `<link>` tags that refer to feeds with content relevant to the particular page. `Zend_Feed` enables you to retrieve all feeds referenced by a web page with one simple method call:

    <?php

    $feedArray = Zend_Feed::findFeeds('http://www.example.com/news.html');

    ?>

Here the `findFeeds()` method returns an array of `Zend_Feed_Abstract` objects that are referenced by `<link>` tags on the news.html web page. Depending on the type of each feed, each respective entry in the `$feedArray` array may be a `Zend_Feed_Rss` or `Zend_Feed_Atom` instance. `Zend_Feed` will throw a `Zend_Feed_Exception` upon failure, such as an HTTP 404 response code or a malformed feed.

上一页 | 上一级 | 下一页
10.2. Importing Feeds with Zend_Feed | 起始页 | 10.4. Consuming an RSS Feed