[Koha-cvs] CVS: koha/rss lastAcquired.conf,NONE,1.1 lastAcquired.tmpl,NONE,1.1 longestUnseen.conf,NONE,1.1 longestUnseen.tmpl,NONE,1.1 mostReserved.conf,NONE,1.1 mostReserved.tmpl,NONE,1.1 rss.pl,NONE,1.1 sm-koha-icon.jpg,NONE,1.1

Joshua Ferraro joshferraro at users.sourceforge.net
Fri Jan 9 21:44:44 CET 2004


Update of /cvsroot/koha/koha/rss
In directory sc8-pr-cvs1:/tmp/cvs-serv15607

Added Files:
	lastAcquired.conf lastAcquired.tmpl longestUnseen.conf 
	longestUnseen.tmpl mostReserved.conf mostReserved.tmpl rss.pl 
	sm-koha-icon.jpg 
Log Message:
Added Pate's Koha rss stuff.


--- NEW FILE ---
channel
title=Recent Koha Acquisitions
link=http://www.koha.org
desc=The 15 most recent acquisitions
lang=en
lastBuild=Fri, 09 May 2003 08:00:00
image
title=Koha, the world's best Open Source Library System
url=http://www.koha.org/images/foo.jpg
link=http://www.koha.org
config
tmpl=lastAcquired.tmpl
output=lastAcquired.xml
query=select biblioitems.isbn as isbn, biblio.title as title, biblio.author as author from biblio, biblioitems, items where biblioitems.biblionumber = items.biblionumber and biblio.biblionumber = items.biblionumber and items.dateaccessioned is not NULL order by items.dateaccessioned desc


--- NEW FILE ---
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications/DTD RSS 0.91/EN"
	  "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

<channel>
 <title><TMPL_VAR CHANNELTITLE></title>
 <link><TMPL_VAR CHANNELLINK></link>
 <description><TMPL_VAR CHANNELDESC></description>
 <language><TMPL_VAR CHANNELLANG></language>
 <lastBuildDate><TMPL_VAR CHANNELLASTBUILD></lastBuildDate>

 <image>
  <title><TMPL_VAR IMAGETITLE></title>
  <url><TMPL_VAR IMAGEURL></url>
  <link><TMPL_VAR IMAGELINK></link>
 </image>

<TMPL_LOOP NAME=ITEMS>
 <item>
  <title><TMPL_VAR TITLE>, by <TMPL_VAR AUTHOR></title>
  <link>http://opac.library.org.nz/cgi-bin/koha/opac-searchresults.pl?isbn=<TMPL_VAR ISBN></link>

 </item>
</TMPL_LOOP>

</channel>
</rss>

--- NEW FILE ---
channel
title=Longest Unseen Koha Items
link=http://www.koha.org
desc=The 15 least recently seen items
lang=en
image
title=Koha, the worlds best Open Source Library System
url=http://www.koha.org/images/foo.jpg
link=http://www.koha.org
config
tmpl=longestUnseen.tmpl
output=longestUnseen.xml
query=select biblioitems.isbn as isbn, biblio.title as title, biblio.author as author from biblio, biblioitems, items where biblioitems.biblionumber = items.biblionumber and biblio.biblionumber = items.biblionumber and items.datelastseen is not NULL and items.datelastseen != items.datelastborrowed order by items.datelastseen


--- NEW FILE ---
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications/DTD RSS 0.91/EN"
	  "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

<channel>
 <title><TMPL_VAR CHANNELTITLE></title>
 <link><TMPL_VAR CHANNELLINK></link>
 <description><TMPL_VAR CHANNELDESC></description>
 <language><TMPL_VAR CHANNELLANG></language>
 <lastBuildDate><TMPL_VAR CHANNELLASTBUILD></lastBuildDate>

 <image>
  <title><TMPL_VAR IMAGETITLE></title>
  <url><TMPL_VAR IMAGEURL></url>
  <link><TMPL_VAR IMAGELINK></link>
 </image>

<TMPL_LOOP NAME=ITEMS>
 <item>
  <title><TMPL_VAR TITLE>, by <TMPL_VAR AUTHOR></title>
  <link>http://opac.library.org.nz/cgi-bin/koha/opac-searchresults.pl?isbn=<TMPL_VAR ISBN></link>

 </item>
</TMPL_LOOP>

</channel>
</rss>

--- NEW FILE ---
channel
title=Most Reserved Items
link=http://www.koha.org
desc=The 15 most reserved items
lang=en
image
title=Koha, the worlds best Open Source Library System
url=http://www.koha.org/images/foo.jpg
link=http://www.koha.org
config
tmpl=mostReserved.tmpl
output=mostReserved.xml
query=select biblioitems.isbn as isbn, biblio.title as title, biblio.author as author from biblio, biblioitems, items where biblioitems.biblionumber = items.biblionumber and biblio.biblionumber = items.biblionumber and items.reserves is not NULL order by items.reserves desc


--- NEW FILE ---
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications/DTD RSS 0.91/EN"
	  "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

<channel>
 <title><TMPL_VAR CHANNELTITLE></title>
 <link><TMPL_VAR CHANNELLINK></link>
 <description><TMPL_VAR CHANNELDESC></description>
 <language><TMPL_VAR CHANNELLANG></language>
 <lastBuildDate><TMPL_VAR CHANNELLASTBUILD></lastBuildDate>

 <image>
  <title><TMPL_VAR IMAGETITLE></title>
  <url><TMPL_VAR IMAGEURL></url>
  <link><TMPL_VAR IMAGELINK></link>
 </image>

<TMPL_LOOP NAME=ITEMS>
 <item>
  <title><TMPL_VAR TITLE>, by <TMPL_VAR AUTHOR></title>
  <link>http://opac.library.org.nz/cgi-bin/koha/opac-searchresults.pl?isbn=<TMPL_VAR ISBN></link>

 </item>
</TMPL_LOOP>

</channel>
</rss>

--- NEW FILE ---
#!/usr/bin/perl -w 

# This script can be used to generate rss 0.91 files for syndication.


# it should be run from cron like:
#
#    rss.pl config.conf
#

# Copyright 2003 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA  02111-1307 USA


use strict;
use HTML::Template;
use C4::Context;
use Time::Local;

my $file = $ARGV[0];
my %config = getConf("config");
my $outFile = $config{"output"};
my $feed = HTML::Template->new(filename => $config{"tmpl"});

my %channel = getConf("channel");
$feed->param(CHANNELTITLE => $channel{'title'});
$feed->param(CHANNELLINK => $channel{'link'});
$feed->param(CHANNELDESC => $channel{'desc'});
$feed->param(CHANNELLANG => $channel{'lang'});
$feed->param(CHANNELLASTBUILD => getDate());

my %image = getConf("image");
$feed->param(IMAGETITLE => $image{'title'});
$feed->param(IMAGEURL => $image{'url'});
$feed->param(IMAGELINK => $image{'link'});

#
# handle the items
#
$feed->param(ITEMS => getItems($config{'query'}));

open(FILE, ">$outFile") or die "can't open $outFile";
print FILE $feed->output();
close FILE;

sub getDate {
    my $date = localtime(timelocal(localtime));
    return $date;
}

sub getConf {
    my $section = shift;
    my %return;
    my $inSection = 0;

    open(FILE,$file) or die "can't open $file";
    while (<FILE>) {
	if ($inSection) {
	    my @line = split(/=/,$_,2);
	    unless ($line[1]) {
		$inSection=0;
	    } else {
		my ($key, $value) = @line;
		chomp $value;
		$return{$key} = $value;
	    }
	} else {
	    if ($_ eq "$section\n") { $inSection = 1 }
	}
    }
    return %return;
}
sub getItems {
    my $query = shift;
    $query .= " limit 15";
    my $dbh = C4::Context->dbh;
    my $sth=$dbh->prepare($query);
    $sth->execute;
    my @return;
    while (my $data = $sth->fetchrow_hashref) {
	foreach my $key (keys %$data) {
	    my $value=$data->{$key};
	    $value=~s/\&/\&amp;/g and $data->{$key}=$value;
	}
	push @return, $data;
    }
    $sth->finish;
    return \@return;
}







--- NEW FILE ---
ÿØÿà

 $.' ",#(7),01444'9=82<.342ÿÛ
I#ŽM,:ôö‡—™­Enw%9b´ê;°ký›^ÜN²¶5ßÃѧÌâ{¶þ#rv9y§š°06;>`âêƒ7Ëóuþʵí}à
„±äÝbrgù䶎åX¡B:S_kgßô<Ë“9Å>­O<$Ð}$Û{wý±Iü>‘#nÐS¥;ŽéU=©üÔÀo/Š51Ý,¦¯.ŽiL›«
îA"ÿ
™9»ÆH\ü1M&O5³˜¸gºg~‘‹,8­ä¾`Õôz%SЖ'¶¦O•×
l=Ü1B§ˆò#Ó¨v¹åòÔ@Rå™®k0@“~”Õ‚§IûaÙÉÊ6Ë2pCThÒ(&ýæ×øâjåTÑÈi`Ö¦àMÄãrÁ#õ¬Þç	Ü܇^(¸MAT«Ë Ä¯+Ìß¡0[Â-1Ñ¡r{ߤþqž‚ßë¦ýó‰¤1þÅ÷?ÿÙ




More information about the Koha-cvs mailing list