use warnings;
use strict;
-use IkiWiki 2.00;
+use IkiWiki 3.00;
use HTML::Parser;
use HTML::Tagset;
use HTML::Entities;
},
aggregateinternal => {
type => "boolean",
- example => 0,
+ example => 1,
description => "enable aggregation to internal pages?",
safe => 0, # enabling needs manual transition
rebuild => 0,
}
sub checkconfig () {
+ if (! defined $config{aggregateinternal}) {
+ $config{aggregateinternal}=1;
+ }
+
if ($config{aggregate} && ! ($config{post_commit} &&
IkiWiki::commit_hook_enabled())) {
launchaggregation();
$feed->{template}=$params{template} . ".tmpl";
delete $feed->{unseen};
$feed->{lastupdate}=0 unless defined $feed->{lastupdate};
+ $feed->{lasttry}=$feed->{lastupdate} unless defined $feed->{lasttry};
$feed->{numposts}=0 unless defined $feed->{numposts};
$feed->{newposts}=0 unless defined $feed->{newposts};
$feed->{message}=gettext("new feed") unless defined $feed->{message};
push @line, "tag=$_" foreach @{$data->{tags}};
}
else {
- push @line, "$field=".$data->{$field};
+ push @line, "$field=".$data->{$field}
+ if defined $data->{$field};
}
}
print OUT join(" ", @line)."\n" || error("write $newfile: $!", $cleanup);
# fields.
foreach my $name (keys %myfeeds) {
if (exists $feeds{$name}) {
- foreach my $field (qw{message lastupdate numposts
- newposts error}) {
+ foreach my $field (qw{message lastupdate lasttry
+ numposts newposts error}) {
$feeds{$name}->{$field}=$myfeeds{$name}->{$field};
}
}
error($@) if $@;
foreach my $feed (@_) {
- $feed->{lastupdate}=time;
+ $feed->{lasttry}=time;
$feed->{newposts}=0;
$feed->{message}=sprintf(gettext("last checked %s"),
- displaytime($feed->{lastupdate}));
+ displaytime($feed->{lasttry}));
$feed->{error}=0;
debug(sprintf(gettext("checking feed %s ..."), $feed->{name}));
debug($feed->{message});
next;
}
+
+ # lastupdate is only set if we were able to contact the server
+ $feed->{lastupdate}=$feed->{lasttry};
+
if ($res->status == URI::Fetch::URI_GONE()) {
$feed->{message}=gettext("feed not found");
$feed->{error}=1;