safe => 1,
rebuild => 0,
},
+ cookiejar => {
+ type => "string",
+ example => { file => "$ENV{HOME}/.ikiwiki/cookies" },
+ safe => 0, # hooks into perl module internals
+ description => "cookie control",
+ },
}
sub checkconfig () {
if (! defined $config{aggregateinternal}) {
$config{aggregateinternal}=1;
}
+ if (! defined $config{cookies}) {
+ $config{cookies}={ file => "$ENV{HOME}/.ikiwiki/cookies" };
+ }
if ($config{aggregate} && ! ($config{post_commit} &&
IkiWiki::commit_hook_enabled())) {
}
$feed->{feedurl}=pop @urls;
}
- my $res=URI::Fetch->fetch($feed->{feedurl});
+ my $res=URI::Fetch->fetch($feed->{feedurl},
+ UserAgent => LWP::UserAgent->new(
+ cookie_jar => $config{cookiejar},
+ ),
+ );
if (! $res) {
$feed->{message}=URI::Fetch->errstr;
$feed->{error}=1;
* comment: Don't show comments of subpages on parent pages.
(Fixes bug introduced in version 3.20100505.)
* darcs: Fix multiple issues preventing rcs_diff from working.
+ * aggregate: Read cookies from ~/.ikiwiki/cookies by default.
+ Also, the cookiejar configuration setting can be used by
+ other plugins to provide a custom `cookie_jar` object for LWP::UserAgent.
+ (Thanks, schmonz)
-- Joey Hess <joeyh@debian.org> Sun, 27 Feb 2011 18:14:05 -0400
HTML, and as first-class wiki pages -- each one generates
a separate HTML page in the output, and they can even be edited. This
option is provided only for backwards compatability.
+
+## cookies
+
+The `cookiejar` option can be used to configure how [[!cpan LWP::UserAgent]]
+handles cookies. The default is to read them from a file
+`~/.ikiwiki/cookies`, which can be populated using standard perl cookie
+tools like [[!cpan HTTP::Cookies]].
>>> `$config{cookies}` (and using it in the aggregate plugin) should
>>> be safe, might help people in typical cases, and won't prevent
>>> further enhancements for less typical cases. --[[schmonz]]
+
+>>>> Ok, done. Called it cookiejar. --[[Joey]]