about changes to rss feeds.
svnpath => "trunk",
srcdir => undef,
destdir => undef,
+ pingurl => [],
templatedir => "/usr/share/ikiwiki/templates",
underlaydir => "/usr/share/ikiwiki/basewiki",
setup => undef,
sub import { #{{{
IkiWiki::hook(type => "preprocess", id => "inline",
call => \&IkiWiki::preprocess_inline);
+ # Hook to change to do pinging since it's called late.
+ # This ensures each page only pings once and prevents slow
+ # pings interrupting page builds.
+ IkiWiki::hook(type => "change", id => "inline",
+ call => \&IkiWiki::pingurl);
} # }}}
# Back to ikiwiki namespace for the rest, this code is very much
# internal to ikiwiki even though it's separated into a plugin.
package IkiWiki;
-
+
+my %toping;
+
sub preprocess_inline (@) { #{{{
my %params=@_;
if ($config{rss}) {
writefile(rsspage($params{page}), $config{destdir},
genrss($params{page}, @pages));
+ $toping{$params{page}}=1;
}
return $ret;
return $template->output;
} #}}}
+sub pingurl (@) { #{{{
+ return unless $config{pingurl} && %toping;
+
+ eval q{require RPC::XML::Client};
+ if ($@) {
+ debug("RPC::XML::Client not found, not pinging");
+ }
+
+ foreach my $page (keys %toping) {
+ my $title=pagetitle(basename($page));
+ my $url="$config{url}/".htmlpage($page);
+ foreach my $pingurl (@{$config{pingurl}}) {
+ my $client = RPC::XML::Client->new($pingurl);
+ my $req = RPC::XML::request->new('weblogUpdates.ping',
+ $title, $url);
+ debug("Pinging $pingurl for $page");
+ my $res = $client->send_request($req);
+ if (! ref $res) {
+ debug("Did not receive response to ping");
+ }
+ my $r=$res->value;
+ if (! exists $r->{flerror} || $r->{flerror}) {
+ debug("Ping rejected: ".$r->{message});
+ }
+ }
+ }
+} #}}}
+
1
* Fix orphans plugin to not count a link to a nonexistant page as a reason
for a page not being an orphan.
+ * Support pinging services such as Technorati using XML-RPC to notify them
+ about changes to rss feeds.
- -- Joey Hess <joeyh@debian.org> Sun, 25 Jun 2006 03:20:48 -0400
+ -- Joey Hess <joeyh@debian.org> Mon, 26 Jun 2006 20:41:45 -0400
ikiwiki (1.7) unstable; urgency=low
Architecture: all
Depends: ${perl:Depends}, markdown, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, libcgi-formbuilder-perl (>= 3.02.02), libtime-duration-perl, libcgi-session-perl, libmail-sendmail-perl, gcc | c-compiler, libc6-dev | libc-dev
Recommends: subversion | git-core, hyperestraier
-Suggests: viewcvs
+Suggests: viewcvs, librpc-xml-perl
Description: a wiki compiler
ikiwiki converts a directory full of wiki pages into html pages suitable
for publishing on a website. Unlike many wikis, ikiwiki does not have its
#anonok => 1,
# Generate rss feeds for pages?
rss => 1,
+ # Urls to ping with XML-RPC when rss feeds are updated
+ #pingurl => [qw{http://rpc.technorati.com/rpc/ping}],
# Include discussion links on all pages?
discussion => 1,
# Time format (for strftime)
The easiest way to install ikiwiki is using the Debian package.
Ikiwiki requires [[MarkDown]] be installed, and also uses the following
-perl modules: `CGI::Session` `CGI::FormBuilder` (version 3.02.02 or
-newer) `HTML::Template` `Mail::SendMail` `Time::Duration` `Date::Parse`
-(libtimedate-perl), `HTML::Scrubber`
+perl modules if available: `CGI::Session` `CGI::FormBuilder` (version
+3.02.02 or newer) `HTML::Template` `Mail::SendMail` `Time::Duration`
+`Date::Parse` (libtimedate-perl), `HTML::Scrubber`, `RPC::XML`
If you want to install from the tarball, you should make sure that the required perl modules are installed, then run:
make
make install
-See [[download]] for where to get it.
\ No newline at end of file
+See [[download]] for where to get it.
All the kinds of plugins that blogging software has is also a possibility:
* Blog post calendar
-* technocrati pinger
* Tag stuff?
If rss is set, ikiwiki will generate rss feeds for pages that inline
a [[blog]].
-* --url http://url/
+* --pingurl url
+
+ Set this to the url to an XML-RPC service to ping when an RSS feed is
+ updated. For example, to ping Technorati, use the url
+ http://rpc.technorati.com/rpc/ping
+
+ This parameter can be specified multiple times to specify more than one
+ url to ping.
+
+* --url url
Specifies the url to the wiki. This is a required parameter in [[CGI]] mode.
"disable-plugin=s@" => sub {
$config{plugin}=[grep { $_ ne $_[1] } @{$config{plugin}} ];
},
+ "pingurl" => sub {
+ push @{$config{pingurl}}, $_[1];
+ }
) || usage();
if (! $config{setup}) {