PHPackages                             tronice/php-rss-writer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tronice/php-rss-writer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tronice/php-rss-writer
======================

Yet another simple RSS writer library for PHP 5.4 or later.

1.6.3(6y ago)0113MITPHPPHP &gt;=5.4.0

Since Aug 22Pushed 4y agoCompare

[ Source](https://github.com/TRONICE/php-rss-writer)[ Packagist](https://packagist.org/packages/tronice/php-rss-writer)[ Docs](https://github.com/TRONICE/php-rss-writer)[ RSS](/packages/tronice-php-rss-writer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (3)Versions (14)Used By (0)

\\Suin\\RSSWriter
=================

[](#suinrsswriter)

`\Suin\RSSWriter` is yet another simple RSS writer library for PHP 5.4 or later. This component is Licensed under MIT license.

This library can also be used to publish Podcasts.

Quick demo
----------

[](#quick-demo)

Blog

```
$feed = new Feed();

$channel = new Channel();
$channel
    ->title('Channel Title')
    ->description('Channel Description')
    ->url('http://blog.example.com')
    ->feedUrl('http://blog.example.com/rss')
    ->language('en-US')
    ->copyright('Copyright 2012, Foo Bar')
    ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->lastBuildDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->ttl(60)
    ->pubsubhubbub('http://example.com/feed.xml', 'http://pubsubhubbub.appspot.com') // This is optional. Specify PubSubHubbub discovery if you want.
    ->appendTo($feed);

// Blog item
$item = new Item();
$item
    ->title('Blog Entry Title')
    ->description('Blog body')
    ->contentEncoded('Blog body')
    ->url('http://blog.example.com/2012/08/21/blog-entry/')
    ->author('John Smith')
    ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->guid('http://blog.example.com/2012/08/21/blog-entry/', true)
    ->preferCdata(true) // By this, title and description become CDATA wrapped HTML.
    ->appendTo($channel);

echo $feed; // or echo $feed->render();
```

Output:

```

    Channel Title
    http://blog.example.com
    Channel Description
    en-US
    Copyright 2012, Foo Bar
    Tue, 21 Aug 2012 10:50:37 +0000
    Tue, 21 Aug 2012 10:50:37 +0000
    60

      Blog Entry Title]]>
      http://blog.example.com/2012/08/21/blog-entry/
      Blog body]]>
      Blog body]]>
      http://blog.example.com/2012/08/21/blog-entry/
      Tue, 21 Aug 2012 10:50:37 +0000
      John Smith

      Some Podcast Entry
      http://podcast.example.com/2012/08/21/podcast-entry/
      &lt;div&gt;Podcast body&lt;/div&gt;

```

Podcast

```
$feed = new Feed();

$itunesCategories = [
    'Sports' => null,
    'Technology' => [
        'Gadgets' => null,
    ],
    'Arts' => null,
];

$channelPodcast = new ChannelPodcast();

$channelPodcast
    ->author('Author')
    ->subtitle('Subtitle')
    ->summary('Summary')
    ->owner(['name'=> 'John', 'email' => 'john@example.com'])
    ->image('https://www.example.com/picture.jpg')
    ->category($itunesCategories);

$channel = new Channel();

$channel
    ->title('Channel Title')
    ->description('Channel Description')
    ->url('http://blog.example.com')
    ->language('en-US')
    ->copyright('Copyright 2012, Foo Bar')
    ->pubDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->lastBuildDate(strtotime('Tue, 21 Aug 2012 19:50:37 +0900'))
    ->ttl(60)
    ->podcast($channelPodcast)
    ->appendTo($feed);

$itemPodcast = new ItemPodcast();
$itemPodcast
    ->author('nono')
    ->subtitle('I am nono subtitle')
    ->image('https://www.example.com/picture.jpg');

$item = new Item();
$item
    ->title('Some Podcast Entry')
    ->description('Podcast body')
    ->url('http://podcast.example.com/2012/08/21/podcast-entry/')
    ->enclosure('http://podcast.example.com/2012/08/21/podcast.mp3', 4889, 'audio/mpeg')
    ->podcast($itemPodcast)
    ->appendTo($channel);

print $feed->asPodcast()->render();
```

Output:

```

    Channel Title
    http://blog.example.com
    Channel Description
    en-US
    Copyright 2012, Foo Bar
    Tue, 21 Aug 2012 18:50:37 +0800
    Tue, 21 Aug 2012 18:50:37 +0800
    60
    Author
    Subtitle
    Summary

      John
      john@example.com

      Some Podcast Entry
      http://podcast.example.com/2012/08/21/podcast-entry/
      &lt;div&gt;Podcast body&lt;/div&gt;

      nono
      I am nono subtitle

```

Installation
------------

[](#installation)

### Easy installation

[](#easy-installation)

You can install directly via [Composer](https://getcomposer.org/):

```
$ composer require tronice/php-rss-writer
```

### Manual installation

[](#manual-installation)

Add the following code to your `composer.json` file:

```
{
    "require": {
        "tronice/php-rss-writer": "dev-master@dev"
    }
}
```

...and run composer to install it:

```
$ composer install
```

Finally, include `vendor/autoload.php` in your product:

```
require_once 'vendor/autoload.php';
```

How to use
----------

[](#how-to-use)

The [`examples`](examples) directory contains usage examples for RSSWriter.

If you want to know APIs, please see [`FeedInterface`](src/Suin/RSSWriter/FeedInterface.php), [`ChannelInterface`](src/Suin/RSSWriter/ChannelInterface.php) and [`ItemInterface`](src/Suin/RSSWriter/ItemInterface.php).

How to Test
-----------

[](#how-to-test)

```
$ vendor/bin/phpunit
```

Test through PHP 5.4 ~ PHP 7.0
------------------------------

[](#test-through-php-54--php-70)

```
$ docker-compose up
```

License
-------

[](#license)

MIT license

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~235 days

Recently: every ~349 days

Total

13

Last Release

2191d ago

PHP version history (2 changes)1.0PHP &gt;=5.3.0

1.3.3PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/64f9bd38feea616bae6f1542c1d0a40d696588e7cb6bb82e0e7fd3474d9cea51?d=identicon)[TRONICE](/maintainers/TRONICE)

---

Top Contributors

[![suin](https://avatars.githubusercontent.com/u/855338?v=4)](https://github.com/suin "suin (36 commits)")[![johnpupu](https://avatars.githubusercontent.com/u/1068032?v=4)](https://github.com/johnpupu "johnpupu (22 commits)")[![buffcode](https://avatars.githubusercontent.com/u/2863518?v=4)](https://github.com/buffcode "buffcode (16 commits)")[![maltsev](https://avatars.githubusercontent.com/u/923973?v=4)](https://github.com/maltsev "maltsev (4 commits)")[![localheinz](https://avatars.githubusercontent.com/u/605483?v=4)](https://github.com/localheinz "localheinz (3 commits)")[![christianp](https://avatars.githubusercontent.com/u/19513?v=4)](https://github.com/christianp "christianp (3 commits)")[![marcdenning](https://avatars.githubusercontent.com/u/2893119?v=4)](https://github.com/marcdenning "marcdenning (2 commits)")[![1franck](https://avatars.githubusercontent.com/u/1209308?v=4)](https://github.com/1franck "1franck (1 commits)")[![jeroenmoors](https://avatars.githubusercontent.com/u/1665245?v=4)](https://github.com/jeroenmoors "jeroenmoors (1 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (1 commits)")[![barryp](https://avatars.githubusercontent.com/u/945959?v=4)](https://github.com/barryp "barryp (1 commits)")

---

Tags

phpfeedrssgeneratorwriter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tronice-php-rss-writer/health.svg)

```
[![Health](https://phpackages.com/badges/tronice-php-rss-writer/health.svg)](https://phpackages.com/packages/tronice-php-rss-writer)
```

###  Alternatives

[suin/php-rss-writer

Yet another simple RSS writer library for PHP 5.4 or later.

2651.4M20](/packages/suin-php-rss-writer)[rumenx/php-feed

Framework-agnostic PHP Feed generator for Laravel, Symfony, and more.

3652.3k](/packages/rumenx-php-feed)[sokolnikov911/yandex-turbo-pages

PHP7 Yandex Turbo Pages RSS feed generator

4686.9k](/packages/sokolnikov911-yandex-turbo-pages)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
