]> sipb.mit.edu Git - ikiwiki.git/commitdiff
aggregate: Allow expirecount to work on the first pass. (expireage still needs to...
authorJoey Hess <joey@kodama.kitenet.net>
Wed, 17 Sep 2008 18:27:31 +0000 (14:27 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Wed, 17 Sep 2008 18:27:31 +0000 (14:27 -0400)
IkiWiki/Plugin/aggregate.pm
debian/changelog
doc/plugins/aggregate/discussion.mdwn

index 85b398063007237eb478cfd6dbaf696372254441..2f20ad2e56411d1f4b0463c3781258db1e338500 100644 (file)
@@ -420,10 +420,10 @@ sub expire () { #{{{
                next unless $feed->{expireage} || $feed->{expirecount};
                my $count=0;
                my %seen;
-               foreach my $item (sort { $IkiWiki::pagectime{$b->{page}} <=> $IkiWiki::pagectime{$a->{page}} }
-                                 grep { exists $_->{page} && $_->{feed} eq $feed->{name} && $IkiWiki::pagectime{$_->{page}} }
+               foreach my $item (sort { ($IkiWiki::pagectime{$b->{page}}||0) <=> ($IkiWiki::pagectime{$a->{page}}||0) }
+                                 grep { exists $_->{page} && $_->{feed} eq $feed->{name} }
                                  values %guids) {
-                       if ($feed->{expireage}) {
+                       if ($feed->{expireage} && $IkiWiki::pagectime{$_->{page}}) {
                                my $days_old = (time - $IkiWiki::pagectime{$item->{page}}) / 60 / 60 / 24;
                                if ($days_old > $feed->{expireage}) {
                                        debug(sprintf(gettext("expiring %s (%s days old)"),
index a84ff36f232c36b0320cb7e15262bc1622ce6fe1..611138cb8b84ebb8f058a5dd5b2648f263799e84 100644 (file)
@@ -1,3 +1,10 @@
+ikiwiki (2.65) UNRELEASED; urgency=low
+
+  * aggregate: Allow expirecount to work on the first pass. (expireage still
+    needs to wait for the pages to be rendered though)
+
+ -- Joey Hess <joeyh@debian.org>  Wed, 17 Sep 2008 14:26:56 -0400
+
 ikiwiki (2.64) unstable; urgency=low
 
   * Avoid uninitialised value when --dumpsetup is used and no srcdir/destdir
index 9077d7eb50c6a0c05a031a491ee4a2a8a3c113bb..3b3d1ea3bf7ccfde596986b7b1ac8a6c40452264 100644 (file)
@@ -11,7 +11,7 @@ I'm trying to set up a [planet of my users' blogs](http://help.schmonz.com/plane
     tag="schmonz"
     ]]
     
-    [[!aggregate
+    \[[!aggregate
     name="Amitai's photos"
     url="http://photos.schmonz.com/"
     dir="planet/schmonz-photos"
@@ -26,6 +26,20 @@ I'm trying to set up a [planet of my users' blogs](http://help.schmonz.com/plane
 Two things aren't working as I'd expect:
 
 1. `expirecount` doesn't take effect on the first run, but on the second. (This is minor, just a bit confusing at first.)
+
+> 
+
 2. Where are the article bodies for e.g. David's and Nathan's blogs? The bodies aren't showing up in the `._aggregated` files for those feeds, but the bodies for my own blog do, which explains the planet problem, but I don't understand the underlying aggregation problem. (Those feeds include article bodies, and show up normally in my usual feed reader rss2email.) How can I debug this further?
 
 --[[schmonz]]
+
+> I only looked at David's, but its rss feed is not escaping the html
+> inside the rss `description` tags, which is illegal for rss 2.0. These
+> unknown tags then get ignored, including their content, and all that's
+> left is whitespace. Escaping the html to `&lt;` and `&gt;` fixes the
+> problem. You can see the feed validator complain about it here:
+> <http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.davidj.org%2Frss.xml>
+> 
+> It's sorta unfortunate that [[cpan XML::Feed]] doesn't just assume the
+> un-esxaped html is part of the description field. Probably other feed
+> parsers are more lenient. --[[Joey]]