-sub initfeed {
- 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";
-
- $feedobj->{-savepath} = $self->{-toppath}.'/'.$feedfile;
- $feedobj->{-file} = $feedfile;
- $feedobj->{-base} = $feedbase;
- $feedobj->{-hub} = $feedhub;
- if ( -f $feedobj->{-file} ) {
- $feedobj->{-feed} = XML::FeedPP::Atom::Atom10->new(
- $feedobj->{-file});
- $feedobj->{-feed}->limit_item(15);
- } else {
- $feedobj->{-feed} = XML::FeedPP::Atom::Atom10->new;
- $feedobj->{-feed}->title("Gallery");
- $feedobj->{-feed}->description("generated by ".
- "<a href=\"http://www.average.org/mkgallery/\">".
- "mkgallery</a>");
- $feedobj->{-feed}->link($feedbase, 'type' => 'text/html', 'rel' => 'alternate');
- $feedobj->{-feed}->xmlns("xmlns:ostatus" =>
- "http://ostatus.org/schema/1.0");
- #$feedobj->{-feed}->copyright("");
- #$feedobj->{-feed}->language("en");
- #$feedobj->{-feed}->image($url, $tit, $link, $desc, $w, $h);
- }
- $self->{-feed} = $feedobj->{-feed};
-}
-