htmllink readfile writefile pagetype srcfile pagename
displaytime strftime_utf8 will_render gettext ngettext urlto targetpage
add_underlay pagetitle titlepage linkpage newpagefile
- inject add_link add_autofile
+ inject add_link add_autofile useragent
%config %links %pagestate %wikistate %renderedfiles
%pagesources %destsources %typedlinks);
our $VERSION = 3.00; # plugin interface version, next is ikiwiki version
safe => 0,
rebuild => 0,
},
+ cookiejar => {
+ type => "string",
+ default => "$ENV{HOME}/.ikiwiki/cookies",
+ description => "cookie control",
+ example => { file => "$ENV{HOME}/.ikiwiki/cookies" },
+ safe => 0, # hooks into perl module internals
+ rebuild => 0,
+ },
}
sub defaultconfig () {
$autofiles{$file}{generator}=$generator;
}
+sub useragent () {
+ return LWP::UserAgent->new(
+ cookie_jar => $config{cookiejar},
+ env_proxy => 1, # respect proxy env vars
+ );
+}
+
sub sortspec_translate ($$) {
my $spec = shift;
my $reverse = shift;
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{cookiejar}) {
- $config{cookiejar}={ file => "$ENV{HOME}/.ikiwiki/cookies" };
- }
# This is done here rather than in a refresh hook because it
# needs to run before the wiki is locked.
}
$feed->{feedurl}=pop @urls;
}
- my $res=URI::Fetch->fetch($feed->{feedurl},
- UserAgent => LWP::UserAgent->new(
- cookie_jar => $config{cookiejar},
- ),
- );
+ my $ua=useragent();
+ my $res=URI::Fetch->fetch($feed->{feedurl}, UserAgent=>$ua);
if (! $res) {
$feed->{message}=URI::Fetch->errstr;
$feed->{error}=1;
$ua=LWPx::ParanoidAgent->new;
}
else {
- $ua=LWP::UserAgent->new;
+ $ua=useragent();
}
# Store the secret in the session.
debug(gettext("LWP not found, not pinging"));
return;
}
- $ua=LWP::UserAgent->new;
+ $ua=useragent();
}
$ua->timeout($config{pinger_timeout} || 15);
* At work, team documentation and project planning: product and sprint
backlogs, burndown charts, release plans/procedures/announcements,
aggregating feeds of shared interest, etc. (with the [[todo/outbound_proxy]]
- patch)
+ patch and [[plugins/contrib/dynamiccookies]] plugin)
* On my laptop, personal to-do and scratch space
* [A small personal site](http://podcast.schmonz.com/) (happily hosted at
[Branchable](http://www.branchable.com/))