By weird chance (really) I stumbled on a description of Paul Hammond’s implementation of the weblogUpdates interface in Perl. His 14 line solution is reproduced here for my future reference:

#!/usr/bin/perl

 
use strict;
use XMLRPC::Transport::HTTP;
my $server = XMLRPC::Transport::HTTP::CGI
  -> dispatch_to('weblogUpdates')
  -> handle;

 
package weblogUpdates;
sub ping {
  my ($class, $weblogname,$weblogurl) = @_;
  print STDERR "got ping from $weblogname at $weblogurl";
  #
  # other code goes here
  #
  return {
    flerror => XMLRPC::Data->type('boolean',0),
    message => "ping recieved"
  };
}

I just hacked something related and similar in Scheme earlier today to allow me to ‘ping’ cs-ed.org to update the “CS-ED blogs” list on the right. Useful snippet of code to hang on to, for the moment.

Comments are closed.