cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

Good day Bros. I am trying to write a CGI app to receive blog pings. The blog pings come in an XMLRPC request that looks like:
<?xml version="1.0"?> <methodCall> <methodName>weblogUpdates.ping</methodName> <params> <param> <value>YOUR WEBLOG NAME HERE</value> </param> <param> <value>http://www.YOURWEBLOGURL.com/</value> </param> </params> </methodCall>
Basically, all I want to do for now is get the params from the ping and store them somewhere.

I have been looking at the docs for XMLRPC::Lite and they're not too helpful because they have the server dispatch_to('methodName') without showing how you set up methodName to handle the dispatch. Does anyone know where I can find some simple example code for making this work?

TIA...Steve

Replies are listed 'Best First'.
Re: XMLRPC::Lite Receiving Blog Pings
by cormanaz (Deacon) on Aug 04, 2008 at 19:27 UTC
    I figured it out...
    use XMLRPC::Transport::HTTP; my $server = XMLRPC::Transport::HTTP::CGI -> dispatch_to('weblogUpdates') -> handle ; package weblogUpdates; sub ping { my @params = @_; open (OUT,">pingdata.txt") or die "Can't open output: $!\n"; for my $i (0..$#params) { print OUT "$params[$i]\n"; } close OUT; return "thanks for the ping." }