A package to easily generate an RSS feed.

0.2.0 2019-11-26 13:11 UTC

This package is auto-updated.

Last update: 2022-06-26 18:57:57 UTC


Build status StyleCI Status Code coverage Total Downloads Latest Stable Version License

This package helps you to very easily generate an Atom Feed for your website.


You can include this package through Composer using:

composer require roelofjan-elsinga/rss-feed-generator


use RssFeedGenerator\RssFeedGenerator;

/**@var \RssFeedGenerator\FeedConfiguration $configuration*/

$generator = RssFeedGenerator::withConfiguration($configuration);

// or

$generator = new RssFeedGenerator($configuration);

/**@var \RssFeedGenerator\FeedItem $feed_item*/


$rss_string = $generator->generate();

print $rss_string;

This will result in:

<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:atom="">
        <title>Feed title</title>
        <link href=""/>
        <description>RSS 2.0 Description</description>
        <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
        <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
        <atom:link href="" rel="self" type="application/rss+xml" />
        <managingEditor> (FirstName LastName)</managingEditor>
        <webMaster> (FirstName LastName)</webMaster>
            <title>Blog post title</title>
            <description>Description of the page</description>
            <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
            <author> (FirstName LastName)</author>


You can run the included tests by running ./vendor/bin/phpunit in your terminal.