The Best PHP Lib/class To Generate 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.
Answer
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.
Features:
- 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.
Supported versions:
- 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
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?