Skip to content

davorg-cpan/template-plugin-xml-feed

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
t
 
 
 
 
 
 
 
 
 
 
 
 

Template::Plugin::XML::Feed - Template Toolkit plugin for XML::Feed

This Template Toolkit plugin provides a simple interface to the XML::Feed module and hence allows information from an Atom or RSS feed to be used within a Template Toolkit template.

Installation

The simplest way to install this module is to use cpanm:

$ cpanm Template::Plugin::XML::Feed

However, if you downloaded the tarball directly, then you can install the module in the traditional manner:

$ tar -xvzf Template-Plugin-XML-Feed-vx.y.z.tar.gz
$ cd Template-Plugin-XML-Feed-vx.y.z
$ perl Makefile.PL
$ make
$ make test
$ make install

Usage

[% USE news = XML.Feed('news.rdf') %]

[% FOREACH item IN news.items %]
   [% item.title %]
   [% item.link  %]
[% END %]

In this example, the RSS feed file news.rdf is read into the news variable and then for each news item within the feed, the title and link for that item are added to the rendered output of the template.

For more information about Template::Plugin::XML::Feed see its documentation by running perldoc:

$ perldoc Template::Plugin::XML::Feed

For more information about how to use the Template Toolkit, see its online documentation.

Development

If you want to help development of Template::Plugin::XML::Feed, then you'll first need to fork the project on GitHub. Then, you can clone your fork via git:

$ git clone git@github.com:<your-github-username>/template-plugin-xml-feed.git

To build and test the software locally, you'll need to ensure that Module::Build is installed:

$ cpanm Module::Build

Then, you can create the Build program and build the module:

$ perl Build.PL
$ ./Build

To run the test suite, simply use the Build program's test argument:

$ ./Build test