What RSS parser should I use in PHP?

跟風遠走 提交于 2019-11-27 04:07:41

问题


I am searching an RSS parser written in PHP. The problem is not that I cannot find one. The problem is that there are too many and it's hard to decide which one to use (especially when I have no experience with them and to try them is too time consuming).

Can anybody recommend me a "good" RSS parser?

The following requirements are important to me (given in order of importance):

  1. It's able to extract all information given in the feed (not only title, description and link but everything what is there, for example feeds author, feeds icon, items tags and so on).
  2. It should be able to read not only RSS feeds but also Atom feeds.
  3. It should be tolerant to "broken" RSS (Atom) feeds.
  4. It should be simple to use.

回答1:


My defacto answer will be "have you tried SimplePie?", it's a very good XML parser but you'll have to have a look at their demo to see how it handles broken feeds :-)




回答2:


In addition to SimplePie already mentioned, there is Zend_Feed (which can be used standalone) and since this is XML anyway, you can also use any of the native XML extensions, like DOM or XMLReader.



来源:https://stackoverflow.com/questions/3656767/what-rss-parser-should-i-use-in-php

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