Giter Club home page Giter Club logo

rss-writer's Introduction

RssWriter

Build Status SensioLabsInsight Coverage Status

A simple, yet powerful and fully customizable RSS 2.0 writing library, with a native support of iTunes podcasting tags and other RSS extensions.

Why a new Rss writing library?

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.

Why should I use this over other libraries?

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

How can I install it?

Run composer require marcw/rss-writer.

How does it work?

Feed creation

See this file.

Rss Streamed Response

See this file.

Symfony Bridge

HttpFoundation

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'));
}

Form

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()])
        // ...
    }
}

Symfony Bundle

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.

Can I contribute?

Sure! Feel free to report issues, send pull-requests, or ask for help.

Projects using this lib

  • Banditore retrieves new releases from your Github starred repositories and put them in a RSS feed.

LICENSE

See the LICENSE file.

rss-writer's People

Contributors

marcw avatar j0k3r avatar

Watchers

James Cloos avatar Surge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.