+sub pingurl (@) { #{{{
+ return unless $config{pingurl} && %toping;
+
+ eval q{require RPC::XML::Client};
+ if ($@) {
+ debug("RPC::XML::Client not found, not pinging");
+ return;
+ }
+
+ 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});
+ }
+ }
+ }
+} #}}}
+