From: Eugene Crosser Date: Mon, 1 Jan 2007 12:29:32 +0000 (+0000) Subject: wip on rss X-Git-Tag: 2.00~61 X-Git-Url: http://www.average.org/gitweb/?p=mkgallery.git;a=commitdiff_plain;h=562bb8dadead7245f944b4f9a8c4752caba651e7;hp=a56e7b4b7a12b446702ab83217f070cd19680a1d;ds=sidebyside wip on rss --- diff --git a/mkgallery.pl b/mkgallery.pl index 493fd5a..4334ef8 100755 --- a/mkgallery.pl +++ b/mkgallery.pl @@ -76,7 +76,11 @@ my $term = new Term::ReadLine "Edit Title"; FsObj->new(getcwd)->iterate; if ($rssobj) { - $rssobj->save($rssfile); + my $itemstodel = @{$rssobj->{'rss'}->{'items'}} - 15; + while ($itemstodel-- > 0) { + pop(@{$rssobj->{'rss'}->{'items'}}) + } + $rssobj->{'rss'}->save($rssobj->{'file'}); } sub help { @@ -165,8 +169,9 @@ sub getrss { last unless ($depth-- > 0); } if ($depth > 0) { - $rssobj = new XML::RSS (version=>2); - $rssobj->parsefile($rss); + $rssobj->{'file'} = $rss; + $rssobj->{'rss'} = new XML::RSS (version=>2); + $rssobj->{'rss'}->parsefile($rss); return $rss; } else { print STDERR "There is no $rssfile in this or parent ". @@ -577,16 +582,13 @@ sub endindex { close($IND) if ($IND); undef $self->{-IND}; - print STDERR "title=",$self->{-title}, - ", numofsubs=",$self->{-numofsubs}, - ", numofimgs=",$self->{-numofimgs},"\n"; if ($rssobj) { my $rsstitle=sprintf "%s [%d images, %d subalbums]", $self->{-title}, $self->{-numofimgs}, $self->{-numofsubs}; - my $rsslink=$rssobj->channel('link')."index.html"; - $rssobj->add_item( + my $rsslink=$rssobj->{'rss'}->channel('link')."index.html"; + $rssobj->{'rss'}->add_item( title => $self->{-title}, link => $rsslink, description => $rsstitle,