Re: [Templates] Info on Template::Plugin::XML::RSS?

[prev] [thread] [next] [Date index for 2004/05/21]

From: Dave Cross
Subject: Re: [Templates] Info on Template::Plugin::XML::RSS?
Date: 05:58 on 21 May 2004
On Thu, May 20, 2004 at 07:32:04PM -0400, Mike Blasenstein wrote:
> My hosting provider has this module, and I'm kind of a Perl/Template
> newbie and am a little lost. I'm finding my way, but it's usually
> easier for me if I have examples and/or documentation to look at.
>  
> I really don't want to do anything fancy; just parse RSS feeds for my
> personal use -- does anyone know of any sample scripts or any
> documentation that doesn't assume I'm an expert programmer? :-)

Well, here's a simple examlpe from the badger book that turns an RSS
file into an HTML page.

[% USE rss = XML.RSS(rssfile) -%]
<html>
  <head>
    <title>[% rss.channel.title | html %]</title>
  </head>
  <body>
    <h1>[% rss.channel.title | html%]</h1>
    <p><a href="[% rss.image.link | html %]"><img
          src="[% rss.image.url | html %]"
          title="[% rss.image.title | html %]"
          alt="[% rss.image.title | html %]" /></a></p>
    <ul>
    [%- FOREACH item = rss.items %]
      <li><a href="[% item.link | html %]">[% item.title |html %]</a></li>
    [% END %]
    </ul>
  </body>
</html>

You just need to pass it the name of an RSS file. So you could, for 
example, process it from the command with tpage like this:

$ tpage --define rssfile=somesite.rss rss.tt


hth,

Dave...

        -- 
          We are far too young and clever

_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Info on Template::Plugin::XML::RSS?
Mike Blasenstein 23:32 on 20 May 2004

Re: [Templates] Info on Template::Plugin::XML::RSS?
Dave Cross 05:58 on 21 May 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52