From 94b31fb3c8acd9dd187c5eacfe6eb6b3caa39aed Mon Sep 17 00:00:00 2001 From: oleonard Date: Wed, 11 Aug 2004 14:53:58 +0000 Subject: [PATCH] Adding more variables for RSS 2.0 template, altering date format for RSS 2.0 compatibility --- rss/rss.pl | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/rss/rss.pl b/rss/rss.pl index a37cf4ae9d..761f53ec16 100755 --- a/rss/rss.pl +++ b/rss/rss.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # This script can be used to generate rss 0.91 files for syndication. @@ -30,7 +30,9 @@ use strict; use HTML::Template; use C4::Context; use Time::Local; +use POSIX; +my $dbh = C4::Context->dbh; my $file = $ARGV[0]; my %config = getConf("config"); my $outFile = $config{"output"}; @@ -47,6 +49,9 @@ my %image = getConf("image"); $feed->param(IMAGETITLE => $image{'title'}); $feed->param(IMAGEURL => $image{'url'}); $feed->param(IMAGELINK => $image{'link'}); +$feed->param(IMAGEDESCRIPTION => $image{'description'}); +$feed->param(IMAGEWIDTH => $image{'width'}); +$feed->param(IMAGEHEIGHT => $image{'height'}); # # handle the items @@ -58,7 +63,8 @@ print FILE $feed->output(); close FILE; sub getDate { - my $date = localtime(timelocal(localtime)); +# my $date = localtime(timelocal(localtime)); + my $date = strftime("%a, %d %b %Y %T %Z", localtime); return $date; } @@ -87,7 +93,6 @@ sub getConf { sub getItems { my $query = shift; $query .= " limit 15"; - my $dbh = C4::Context->dbh; my $sth=$dbh->prepare($query); $sth->execute; my @return; @@ -100,10 +105,4 @@ sub getItems { } $sth->finish; return \@return; -} - - - - - - +} \ No newline at end of file -- 2.20.1