GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Dancer::Plugin::Feed(3) User Contributed Perl Documentation Dancer::Plugin::Feed(3)

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

version 1.131470

    use Dancer;
    use Dancer::Plugin::Feed;
    use Try::Tiny;

    get '/feed/:format' => sub {
        my $feed;
        try {
            $feed = create_feed(
                format  => params->{format},
                title   => 'my great feed',
                entries => [ map { title => "entry $_" }, 1 .. 10 ],
            );
        }
        catch {
            my ( $exception ) = @_;

            if ( $exception->does('FeedInvalidFormat') ) {
                return $exception->message;
            }
            elsif ( $exception->does('FeedNoFormat') ) {
                return $exception->message;
            }
            else {
                $exception->rethrow;
            }
        };

        return $feed;
    };

    dance;

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.

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

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::Entry object. Each entry is an hashref. Some common attributes for these hashrefs are "title", "link", "summary", "content", "author", "issued" and "modified". Check XML::Feed::Entry for more details.
title
base
link
tagline
description
author
language
copyright
self_link
modified

This method call create_feed by setting the format to Atom.

This method call create_feed by setting the format to RSS.

FeedNoFormat
FeedInvalidFormat

This module is developed on Github at:

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

Feel free to fork the repo and submit pull requests

Alexis Sukrieh and Franck Cuny

Please report any bugs or feature requests in github.

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

    perldoc Dancer::Plugin::Feed

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

Natal Ngétal

This software is copyright (c) 2013 by Natal Ngétal.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2013-05-27 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.