Is there a PHP feed reader for both RSS and ATOM? [closed]

妖精的绣舞 提交于 2019-12-13 13:24:15

问题


I need a PHP library/script that can retreive data from feeds, no matter if they are RSS or ATOM, because I want users to insert random feeds which will then be stored in a database. It would also be great if it could check whether a given URL is a feed or not.

If anything exists that could help me out, could anyone tell me? Thanks!


回答1:


Try these two, they both do RSS and Atom:

  • SimplePie
  • PHP Universal Feed Parser



回答2:


Zend_Feed

Zend_Feed provides functionality for consuming RSS and Atom feeds. It provides a natural syntax for accessing elements of feeds, feed attributes, and entry attributes. Zend_Feed also has extensive support for modifying feed and entry structure with the same natural syntax, and turning the result back into XML. In the future, this modification support could provide support for the Atom Publishing Protocol.

You don't have to use the entire Zend Framework, just take the Zend_Feed component and its dependencies.




回答3:


Recently I have created a php feed reader class which can parse both RSS and Atom feed. Here is the link http://raynux.com/blog/2009/09/02/rayfeedreader-php-class-for-parsing-rss-and-atom-feed/.




回答4:


This can be easily handled by SimpleXML and would require no code from anyone else but yourself. Just remember that SimpleXML will crap itself if you supply it a file that is invalid or doesn't exist. Use try/catch + execeptions.

http://us2.php.net/simplexml



来源:https://stackoverflow.com/questions/524024/is-there-a-php-feed-reader-for-both-rss-and-atom

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!