Zend_Feed-FindFeeds.xml 1.3 KB

1234567891011121314151617181920212223242526272829
  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 <emphasis>&lt;link&gt;</emphasis> tags that refer to feeds with
  7. content relevant to the particular page. <classname>Zend_Feed</classname> enables you to
  8. retrieve all feeds referenced by a web page with one simple method call:
  9. </para>
  10. <programlisting language="php"><![CDATA[
  11. $feedArray = Zend_Feed::findFeeds('http://www.example.com/news.html');
  12. ]]></programlisting>
  13. <para>
  14. Here the <methodname>findFeeds()</methodname> method returns an array of
  15. <classname>Zend_Feed_Abstract</classname> objects that are referenced by
  16. <emphasis>&lt;link&gt;</emphasis> tags on the <filename>news.html</filename> web page.
  17. Depending on the type of each feed, each respective entry in the
  18. <varname>$feedArray</varname> array may be a <classname>Zend_Feed_Rss</classname> or
  19. <classname>Zend_Feed_Atom</classname> instance. <classname>Zend_Feed</classname> will throw
  20. a <classname>Zend_Feed_Exception</classname> upon failure, such as an
  21. <acronym>HTTP</acronym> 404 response code or a malformed feed.
  22. </para>
  23. </sect1>
  24. <!--
  25. vim:se ts=4 sw=4 et:
  26. -->