Dancer::Plugin::XML::RSS - Dancer plugin for using XML::RSS to parse or create RSS feeds
Version 0.01
Allows access to XML::RSS object from inside of your Dancer application and default configuration of XML::RSS using the standard Dancer configuration file.
package MyDancerApp; use Dancer 'syntax'; use Dancer::Plugin::XML::RSS; # parse rss file and output get '/show_news' => { rss->parsefile( settings( 'news_feed' ) ); # grab entries for template my @stories; my $display_max = settings('news_feed_display') || 5; for ( my $i = 0; $i <= $display_max; $i++ ) { next unless exists rss->{items}->[$i] and ref rss->{items}; push @stories, $item; } template 'news', { stories => \@stories }; }; get '/our_feed' => { rss->channel( title => 'My Special Site', link => 'mysite.example.org', description => 'A generic example for docs', ); rss->add_item( ); rss_output; };
Provides a simple way to parse RSS files by using XML::RSS. It will hold onto currently parsed feed or keyword 'rss' will return object instance for application use.
XML::RSS
Using the 'rss_output' command it will first create correct content type and then serialize object into RSS XML for use in route.
XML:RSS configuration parameters will be taken from your Dancer application config file. They should be specified as:
Dancer
plugins: 'XML::RSS': output: '0.9' # output as rss v0.9
See XML::RSS for more detail on configuration options.
Creates and returns XML::RSS object. It will be setup with any XML::RSS options from configuration file.
After first call to rss existing XML::RSS object will be called to force a new object pass 'new' to rss
rss
Converts XML::RSS object into xml with correct content type and body. Use for returning inside of route.
Lee Carmichael, <lcarmich at cpan.org>
<lcarmich at cpan.org>
Please report any bugs or feature requests to bug-dancer-plugin-xml-rss at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Dancer-Plugin-XML-RSS. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dancer-plugin-xml-rss at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Dancer::Plugin::XML::RSS
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Dancer-Plugin-XML-RSS
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Dancer-Plugin-XML-RSS
CPAN Ratings
http://cpanratings.perl.org/d/Dancer-Plugin-XML-RSS
Search CPAN
http://search.cpan.org/dist/Dancer-Plugin-XML-RSS/
Add configuration of output header with config file
Use configuration file to setup details of channel for rss output
Copyright 2011 Lee Carmichael.
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.
Dancer, XML::RSS, Dancer::Plugin, Dancer::Plugin::Feed
Dancer::Plugin
Dancer::Plugin::Feed
To install Dancer::Plugin::XML::RSS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::Plugin::XML::RSS
CPAN shell
perl -MCPAN -e shell install Dancer::Plugin::XML::RSS
For more information on module installation, please visit the detailed CPAN module installation guide.