Daniel W. Ottey (dottey) wrote in lj_clients,
Daniel W. Ottey
dottey
lj_clients

XML RPC question

I have been experimenting with the XML RPC interface using a perl program.  I'll let it be known up front that I am a novice at both, and so my question may be pretty stupid.  But hopefully someone can help me.

I am using as a basis a script Brad wrote http://cvs.livejournal.org/browse.cgi/livejournal/src/xmlrpc-client/

I am attempting to use/learn the getevents call.

    $xmlrpc->proxy("http://$acct->{'host'}/interface/xmlrpc");
    my $req = {
         'username' => $acct->{'username'},
         'password' => $acct->{'password'},
         'truncate' => '20',
         'selecttype' => 'day',
         'year' => '2004',
         'month' => '12',
         'day' => '29',
    };
    my $res = $xmlrpc->call('LJ.XMLRPC.getevents', $req);
    if ($res->events) {
        print "blah\n";
        print "Event: " . $res->event;
    }

With this I receive an error:
Can't locate object method "events" via package "XMLRPC::SOM" at ./dan.pl line 41, <C> line 1.

So I'd like to know how to properly retrieve the struct containing an array of events.  And how should I traverse them?  (example: how would I list the subject from each event on that day?)

Thanks for any help!

Subscribe
  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 4 comments