A simple, yet powerful and fully customizable RSS 2.0 writing library, with a native support of iTunes podcasting tags and other RSS extensions.
At the time of writing this library, the current state of feed writing libraries was not satisfying. What I found was either difficult to extend, too generic, or wasn't taking advantage of best practices in order to reduce the Time To First Byte.
Use this library if you want:
- RSS2 feeds (because there's no support for other types of feed).
- Extensions for iTunes podcasting, Slash, Sy, DublinCreator, Atom, or just your own.
- Best performance (memory and TTFB) thanks to XML Streaming.
- Object oriented feed creation with POPO
Run composer require marcw/rss-writer
.
See this file.
See this file.
The library provides an extension to the Symfony\Component\HttpFoundation\Response
class for streaming rss responses to the client. See RssStreamedResponse.php
.
Use it from your controllers like this:
use MarcW\RssWriter\Bridge\Symfony\HttpFoundation\RssStreamedResponse;
public function myAction()
{
// $channel = ... (whatever you use to create your Channel object)
return new RssStreamedResponse($channel, $this->get('marcw_rss_writer.rss_writer'));
}
An iTunes category choice list is available to use in your forms. Follow this example:
<?php
namespace AppBundle\Form;
use MarcW\RssWriter\Bridge\Symfony\Form\ChoiceList\Loader\ItunesCategoryChoiceLoader;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
class MyFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
$builder->add('category', ChoiceType::class, ['choice_loader' => new ItunesCategoryChoiceLoader()])
// ...
}
}
This library also provides a Symfony bundle.
Add this to your AppKernel.php
file.
new MarcW\RssWriter\Bundle\MarcWRssWriterBundle()
You can now use the marcw_rss_writer.rss_writer
service.
Sure! Feel free to report issues, send pull-requests, or ask for help.
- Banditore retrieves new releases from your Github starred repositories and put them in a RSS feed.
See the LICENSE file.