arms

xmlrpc is really easy in

python

 .
nop_90 already pointed out how you just create an object and call the xml-rpc methods on the object itself.

to post to a livejournal blog:


import xmlrpclib
import datetime

server = xmlrpclib.ServerProxy("http://www.livejournal.com/interface/xmlrpc"Applause
now = datetime.datetime.now()
# the livejournal xml-rpc reference: http://www.livejournal.com/doc/server/ljp.csp.xml-rpc.postevent.html
# defines the args for the postevent method as a 'struct' which translates to a dictionary in

python

 
args = {"username" : "username",
        "password" : "password",
        "event" : "They dyed me this color! That's how clever they are!",
        "subject" : "I'm thinking with sand here",
        "year" : now.year,
        "mon" : now.month,
        "day" : now.day,
        "hour": now.hour,
        "min" : now.minute
}
# call the remote method as a method of the server object
response = server.LJ.XMLRPC.postevent(args)
print response


Perkiset's Place Home   Politics @ Perkiset's