Developed with love by KnpLabs Hire us for your project!
44

FeedBundle

by Nekland

Easy manage of your feeds (Rss, Atom, and more if you want) with Symfony2

FeedBundle

Version 2.0
Changes:
* Tested for Symfony 2.1
* Added composer support
* Namespace changed
* (versioning change)

Version 1.1
Changes:
* in the configuration you need to defined an url, not a route. (Maybe another website ? You can type what you want)
* the method getFeedRoute become getFeedRoutes in the ItemInterface (it's an array of routes).
For more information, see the ItemInterface or the wiki.
* for naming your feeds you must add |format| (where you want in the filename)

Version 1.0
Warning: finally the new version (1.1) make substantial changes, but not in the code logic.

Features

  • can make atom and rss 2.0 feeds
  • support multiple feeds
  • support edit of feeds
  • extensible
  • On-the-fly and at-save feed generation

Read about configuration and more on the wiki

https://github.com/Nekland/FeedBundle/wiki

Configuration

app/config.yml

    nekland_feed:
        feeds:
            my_feed:
                class:        My\MyBundle\Entity\Post
                title:       'My fabulous posts'
                description: 'Here is my very fabulous posts'
                url:         'http://my-website.com'
                language:    'fr'
            my_feed2:
                class:        My\MyBundle\Entity\Comment
                title:       'My fabulous comments'
                description: 'Here is my very fabulous comments'
                url:         'http://my-website.com'
                language:    'fr'

Optional (default values):
YAML
nekland_feed:
feeds:
...
renderers:
rss:
id: nekland_feed.renderer.rss
loaders:
rss_file:
id: nekland_feed.loader.rss_file

Notice that if you want change the path where are saved files, you can redefined this option:
```YAML

Default path

nekland_feed.feeds.base_path: %kernel.root_dir%/../web/feeds
```

Models

To use the NeklandFeedBundle, you must have class that implements the ItemInterface. In most of case,
you can do it with your entities/documents
PHP
class Post implements ItemInterface
{
//.....
}

Usage

Retrieve your feed instance

    $container->get('nekland_feed.factory')->get('my_feed');

If your controller extends the base Symfony controller, you can use
PHP
$this->get('nekland_feed.factory')->get('my_feed');

Render the feed

    $factory->render('my_feed', 'renderer');

Add an item

    /** @var $post My\MyBundle\Entity\Post */
    $factory->load('my_feed', 'loader');
    $factory->get('my_feed')->add($post);

Tests

NeklandFeedBundle is bundled with some behat flavoured tests. Install BehatBundle and launch it with

app/console -e=test behat @NeklandFeedBundle

TODO

  • Annotation configuration

Author :

Contributors :

Copyright (c) 2012 Nekland

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
nekland_feed:
feeds:

# Prototype
name:
class: ~ # Required
filename: ~ # Required
title: ~ # Required
description: ~ # Required
language: ~ # Required
url: ~
max_items: 10
copyright: ~
managingEditor: ~
generator: ~
webMaster: ~
rights: ~
subtitle: ~
icon: ~
image:
url: ~ # Required
title: ~ # Required
link: ~ # Required
width: ~
height: ~
description: ~
renderers:

# Prototype
name:
id: ~ # Required
loaders:

# Prototype
name:
id: ~ # Required
  • Fixed wrong license name
    By Nek-, 3 years ago
  • Merge pull request #23 from dbu/fix-router-dep
    By Nek-, 4 years ago
  • should depend on the router interface, not the router class
    By dbu, 4 years ago
  • And here we go, another nek to nekland
    By Nek-, 4 years ago
  • Grrr. The homepage changed since.. a long time !
    By Nek-, 4 years ago
  • Delete "version" option. This is useless.
    By Nek-, 4 years ago
  • Fixed #21
    By Nek-, 4 years ago
  • Fixed readme
    By Nek-, 4 years ago
  • Updated Changelog
    By Nek-, 4 years ago
  • Fixed RSS Renderer (version 2.0.5)
    By Nek-, 4 years ago
  • Added licence
    By Nek-, 4 years ago
  • New changelog
    By Nek-, 4 years ago
  • Fixed bad namespace in services
    By Nek-, 4 years ago
  • Fixed loaders :
    By Nek-, 4 years ago
  • Fixed missing argument in generic item
    By Nek-, 4 years ago
  • Fixed bad namespace in tests
    By Nek-, 4 years ago
  • Fixed bad namespaces in atom loader
    By Nek-, 4 years ago
  • Merge pull request #16 from pborreli/typos
    By Nek-, 4 years ago
  • Fixed typos
    By pborreli, 4 years ago
  • Merge pull request #15 from lsmith77/patch-2
    By Nek-, 4 years ago
  • typo fixes
    By lsmith77, 4 years ago
  • Changed changelog
    By Veber, 4 years ago
  • Update Resources/config/services.xml
    By Nek-, 4 years ago
  • Updated readme to redirect reader to wiki
    By Nek-, 4 years ago
  • Updated readme
    By Nek-, 4 years ago
  • Added composer.json file
    By Nek-, 4 years ago
  • Updated documentation
    By Nek-, 4 years ago
  • Removed useless slash to path parameter
    By Nek-, 4 years ago
  • Added some comments to Feed.php
    By Nek-, 4 years ago
  • Changed namespace to be in the classic namespace normes
    By Nek-, 4 years ago