生成RSS/Atom的最佳PHP库/类 [英] The best PHP lib/class to generate RSS/Atom

查看:79
本文介绍了生成RSS/Atom的最佳PHP库/类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在各种应用程序中生成RSS/Atom提要,并且我想知道一个既可以生成二者又可以处理所有常见问题的好的库或类.

I have to produce an RSS/Atom feed in various applications, and I want to know a good library or class which is able to produce both, and which already handles all common problems.

例如,我使用多年的格式没有为日期设置正确的格式,因此我的供稿没有被几个聚合器很好地处理.

For example, the one I used for years does not put the right format for date, so my feed is not well-handled by several aggregators.

更新: 为什么我要寻找图书馆?因为我使用了几年的东西(被黑客砍了几次)有一个小问题.也许没有正确遵循规范.

Update: Why I am looking for a library? Because the one I used for years, which I had hacked a few times, has a little problem. Maybe a specification is not being correctly followed.

为什么我的RSS feed重复了某些条目?

推荐答案

The PHP Universal Feed Generator seems to be exactly what you're after - it has a simple, OO-based way of declaring a new feed and outputting it to your desired specification.

它还具有内置的日期格式转换,这是它的功能之一.

It also has built-in date format conversions as one of it's features.

功能:

  • 生成RSS 1.0,RSS 2.0和ATOM 1.0提要
  • 所有供稿均由供稿验证器验证.
  • 为不同版本实现适当的命名空间.
  • 自动转换日期格式.
  • 为ATOM提要生成UUID.
  • 处理所需标签的CDATA编码.
  • Generates RSS 1.0, RSS 2.0 and ATOM 1.0 feeds
  • All feeds are are validated by feed validator.
  • Implements appropriate namespaces for different versions.
  • Automatically converts date formats.
  • Generates UUID for ATOM feeds.
  • Handles CDATA encoding for required tags.

支持的版本:

  • RSS 1.0(正式淘汰RSS 0.90)
  • RSS 2.0(正式淘汰RSS 0.91、0.92、0.93和0.94)
  • ATOM 1.0
  • RSS 1.0 (which officially obsoleted RSS 0.90)
  • RSS 2.0 (which officially obsoleted RSS 0.91, 0.92, 0.93 and 0.94)
  • ATOM 1.0

这篇关于生成RSS/Atom的最佳PHP库/类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆