move rss gen where it belongs
authorEugene Crosser <crosser@average.org>
Tue, 19 Aug 2008 07:03:57 +0000 (07:03 +0000)
committerEugene Crosser <crosser@average.org>
Tue, 19 Aug 2008 07:03:57 +0000 (07:03 +0000)
mkgallery.pl

index c7d3f46391a0e2a1b1e3271b90f5b208497a9726..085f42a7a0600826a41c64d609cf9d30661462d8 100755 (executable)
@@ -75,14 +75,6 @@ my $term = new Term::ReadLine "Edit Title";
 
 FsObj->new(getcwd)->iterate;
 
-if ($rssobj) {
-       my $itemstodel = @{$rssobj->{'rss'}->{'items'}} - 15;
-       while ($itemstodel-- > 0) {
-               pop(@{$rssobj->{'rss'}->{'items'}})
-       }
-       $rssobj->{'rss'}->save($rssobj->{'file'});
-}
-
 sub help {
 
        print STDERR <<__END__;
@@ -172,6 +164,11 @@ sub getrss {
                $rssobj->{'file'} = $rss;
                $rssobj->{'rss'} = new XML::RSS (version=>2);
                $rssobj->{'rss'}->parsefile($rss);
+               my $itemstodel = @{$rssobj->{'rss'}->{'items'}} - 15;
+               while ($itemstodel-- > 0) {
+                       pop(@{$rssobj->{'rss'}->{'items'}})
+               }
+               $rssobj->{'rss'}->save($rssobj->{'file'});
                return $rss;
        } else {
                print STDERR "There is no $rssfile in this or parent ".