Zend_Feed-FindFeeds.xml 1.2 KB

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.feed.findFeeds">
  4. <title>Retrieving Feeds from Web Pages</title>
  5. <para>
  6. Web pages often contain <code>&lt;link&gt;</code> tags that refer to feeds with content relevant to
  7. the particular page. <classname>Zend_Feed</classname> enables you to retrieve all feeds referenced by a web
  8. page with one simple method call:
  9. </para>
  10. <programlisting role="php"><![CDATA[
  11. $feedArray = Zend_Feed::findFeeds('http://www.example.com/news.html');
  12. ]]></programlisting>
  13. <para>
  14. Here the <code>findFeeds()</code> method returns an array of <classname>Zend_Feed_Abstract</classname>
  15. objects that are referenced by <code>&lt;link&gt;</code> tags on the news.html web page. Depending on
  16. the type of each feed, each respective entry in the <code>$feedArray</code> array may be a
  17. <classname>Zend_Feed_Rss</classname> or <classname>Zend_Feed_Atom</classname> instance. <classname>Zend_Feed</classname> will throw a
  18. <classname>Zend_Feed_Exception</classname> upon failure, such as an HTTP 404 response code or a malformed feed.
  19. </para>
  20. </sect1>
  21. <!--
  22. vim:se ts=4 sw=4 et:
  23. -->