我应该在 PHP 中使用什么 RSS 解析器?

发布于 2024-09-17 23:19:11 字数 324 浏览 4 评论 0 原文

我正在搜索用 PHP 编写的 RSS 解析器。问题不是我找不到。问题是太多了,很难决定使用哪一个(特别是当我没有使用它们的经验并且尝试它们太耗时时)。

有人能给我推荐一个“好的”RSS 解析器吗?

以下要求对我来说很重要(按重要性顺序给出):

  1. 它能够提取提要中给出的所有信息(不仅是标题、描述和链接,还有其中的所有内容,例如提要作者、提要图标、项目标签和很快)。
  2. 它不仅应该能够读取 RSS 提要,还应该能够读取 Atom 提要。
  3. 它应该能够容忍“损坏的”RSS (Atom) 提要。
  4. 使用起来应该很简单。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笑,眼淚并存 2024-09-24 23:19:11

我事实上的答案是“你尝试过 SimplePie 吗?”,它是一个非常好的 XML 解析器,但你必须这样做看看他们的演示,看看它如何处理损坏的提要:-)

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 :-)

ヅ她的身影、若隐若现 2024-09-24 23:19:11

除了已经提到的 SimplePie 之外,还有 Zend_Feed (可以使用独立)并且由于无论如何这是 XML,因此您还可以使用 任何本机 XML 扩展,例如 DOMXMLReader

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文