-sub initrss {
- my $self=shift; # this is not a method but we cheat
- my $fullpath=$self->{-fullpath};
- my $toppath=$self->{-toppath};
- my $inc=$self->{-inc}.$incdir.'/';
- my $conffile=$toppath.'/'.$incdir.'/feed.conf';
- my $CONF;
-
- if (! $incpath) {
- if ($feed) {
- if (open($CONF,">".$conffile)) {
- print $CONF $feed,"\n";
- close($CONF);
- } else {
- print STDERR "could not open $conffile: $!\n";
- }
- } else {
- if (open($CONF,$conffile)) {
- $feed=<$CONF>;
- close($CONF);
- chop $feed;
- }
- }
- }
-
- return unless ($feed);
-
- my ($feedfile, $feedbase, $feedhub) = split(',', $feed);
- $feedbase .= '/' unless ($feedbase =~ /\/$/);
- print "($feedfile, $feedbase, $feedhub)\n";
-
- $rssobj->{-savepath} = $self->{-toppath}.'/'.$feedfile;
- $rssobj->{-file} = $feedfile;
- $rssobj->{-base} = $feedbase;
- $rssobj->{-hub} = $feedhub;
- $rssobj->{-rss} = new XML::RSS (version=>'2.0');
- if ( -f $rssobj->{-file} ) {
- $rssobj->{-rss}->parsefile($rssobj->{-file});
- my $itemstodel = @{$rssobj->{-rss}->{'items'}} - 15;
- while ($itemstodel-- > 0) {
- pop(@{$rssobj->{-rss}->{'items'}})
- }
- $rssobj->{-rss}->save($rssobj->{-savepath});
- } else {
- $rssobj->{-rss}->channel(
- title=>'Gallery',
- link=>$feedbase,
- description=>'Gallery Feed',
- #language=>$language,
- #rating=>$rating,
- #copyright=>$copyright,
- #pubDate=>$pubDate,
- #lastBuildDate=>$lastBuild,
- #docs=>$docs,
- #managingEditor=>$editor,
- #webMaster=>$webMaster
- );
- $rssobj->{-rss}->save($rssobj->{-savepath});
- }
- $self->{-rss} = $rssobj->{-rss};
-}
-