The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Dancer::Plugin::Feed - easy to generate feed rss or atom for Dancer applications.

SYNOPSIS

    use Dancer;
    use Dancer::Plugin::Feed;

    get '/feed/:format' => sub {
        my $feed = create_feed(
            format  => params->{format},
            title   => 'my great feed',
            entries => _get_entries(),
        );
        return $feed;
    };

    sub _get_entries {
        [ map { { title => "entry $_" } } ( 1 .. 10 ) ];
    }

    dance;

DESCRIPTION

Provides an easy way to generate RSS or Atom feed. This module relies on XML::Feed. Please, consult the documentation of XML::Feed and XML::Feed::Entry.

CONFIGURATION

 plugins:
   Feed:
     title: my great feed
     format: Atom

FUNCTIONS

create_feed

This function returns a XML feed. All parameters can be define in the configuration

Accepted parameters are:

format (required)

The Content-Type header will be set to the appropriate value

entries

An arrayref containing a list of entries. Each item will be transformed to an XML::Feed::Entries object.

title
base
tagline
description
author
language
modified

create_atom_feed

This method call create_feed by setting the format to Atom.

create_rss_feed

This method call create_feed by setting the format to RSS.

AUTHOR

Natal Ngétal, <hobbestigrou@erakis.im>

CONTRIBUTING

This module is developed on Github at:

http://github.com/hobbestigrou/Dancer-Plugin-Feed

Feel free to fork the repo and submit pull requests

ACKNOWLEDGEMENTS

Alexis Sukrieh and Franck Cuny

BUGS

Please report any bugs or feature requests in github.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Dancer::Plugin::Feed

LICENSE AND COPYRIGHT

Copyright 2010 Natal Ngétal.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

SEE ALSO

Dancer XML::Feed XML::Feed::Entry