[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/rss lastAcquired.conf,NONE,1.1 lastAcquired.tmpl,NO
From: |
Joshua Ferraro |
Subject: |
[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 |
Date: |
Fri, 09 Jan 2004 12:44:44 -0800 |
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/\&/\&/g and $data->{$key}=$value;
}
push @return, $data;
}
$sth->finish;
return address@hidden;
}
--- NEW FILE ---
ÿØÿà
$.' ",#(7),01444'9=82<.342ÿÛ
I#M,:ôöÂEnw%9b´ê;°ký^ÜN²¶5ßÃѧÌâ{¶þ#rv9y§°06;>`âê7Ëóuþʵí}à
±äÝbrgùä¶åX¡B:S_kgßô<Ë9Å>O<$Ð}$Û{wý±Iü>#nÐS¥;éU=©üÔÀo/51Ý,¦¯.iL«
îA"ÿ
9»ÆH\ü1M&O5³¸gºg~,8ä¾`Õôz%SÐ'¶¦O×
address@hidden@~Õ§IûaÙÉÊ6Ë2pCThÒ(&ýæ×øâjåTÑÈi`Ö¦àMÄãrÁ#õ¬Þç
ÜÜ^(¸MAT«Ë į+Ìß¡0[Â-1Ñ¡r{ߤþqßë¦ýó¤1þÅ÷?ÿÙ
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [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 <=
- Prev by Date:
[Koha-cvs] CVS: koha/rss README,NONE,1.1
- Next by Date:
[Koha-cvs] CVS: koha/misc/translator opac-css.fr,1.1.2.1,1.1.2.2 tmpl_process.pl,1.5.2.1,1.5.2.2
- Previous by thread:
[Koha-cvs] CVS: koha/rss README,NONE,1.1
- Next by thread:
[Koha-cvs] CVS: koha/misc/translator opac-css.fr,1.1.2.1,1.1.2.2 tmpl_process.pl,1.5.2.1,1.5.2.2
- Index(es):