?

Log in

No account? Create an account
xmlrpc interface? - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

xmlrpc interface? [Mar. 28th, 2002|03:24 am]
LiveJournal Client Discussions

lj_clients

[wolfieboy]
[mood |confusedconfused]
[music |Red Red Groovy - The Fabric of Space]

I noticed while browsing around in the code that there is an xmlrpc interface available. Since I'd like to write a client that can determine a users (mine actually) communities whether they are friends or not, I thought this might be very useful so that I could get the full structure of getfriends back rather than just the flat interface.

I tried accessing it with:
my $cli = RPC::XML::Client->new('http://www.livejournal.com/interface/xmlrpc');
my $struct = RPC::XML::struct->new({ user => RPC::XML::string->new('wolfieboy'),
hpassword => RPC::XML::string->new(md5_hex('elided'))
});
my $req = RPC::XML::request->new('LJ.Protocol.getfriends', $struct);

but when I did so, I recieved:
Denied access to method (getfriends) in class (LJ::Protocol) at /usr/share/perl5/SOAP/Lite.pm line 2113.

So, what am I doing wrong here? I've done very little xml-rpc programming, so I could easily be making a variety of errors.
Then again, it's possible that access to the xmlrpc interface is restricted but I think the former is more likely.
linkReply

Comments:
[User Picture]From: jingoro
2002-03-28 05:14 am (UTC)
I hope you didn't just toss out your actual password in that code. You might want to test using the test account ('test','test') just so you avoid accidentally disclosing such things.

I only comment as I nearly did the same thing yesterday.
(Reply) (Thread)
[User Picture]From: wolfieboy
2002-03-28 07:48 am (UTC)
Note that elided means to deliberately omit.
(Reply) (Parent) (Thread)
[User Picture]From: jingoro
2002-03-28 11:07 am (UTC)
Learn something new every day.
(Reply) (Parent) (Thread)
From: evan
2002-03-28 11:34 am (UTC)
From the doc:
Note: The full title of each method is actually LJ.XMLRPC.foo, where foo is the short name given below:

And I think you're specifying LJ.Protocol.foo.
(Reply) (Thread)
[User Picture]From: wolfieboy
2002-03-28 12:57 pm (UTC)
What doc? I haven't found a good doc on this, I gleaned most of this from code after I found the doc/raw/int/protocol directory. It talks about the various methods that can be called but doesn't appear to actually document how to call the methods themselves. By knowing what you've said and what little SOAP I know, I see that I might've been able to figure this out by looking closer at the AUTOLOAD method in htdocs/interface.
(Reply) (Parent) (Thread)
From: evan
2002-03-28 02:54 pm (UTC)
Ah, I assumed you were programming from the docs. I'm impressed you got as far as you did without them!

The current URL seems to be
http://www.livejournal.com/doc/hack/
But I doubt that's linked from anywhere.
The XML-RPC interface hasn't been extensively tested AFAIK.
(Reply) (Parent) (Thread)
[User Picture]From: wolfieboy
2002-03-28 03:58 pm (UTC)
I actually succeeded once I got the URI correct. Well, that and specifying username instead of user.
This is not the first time that I've figured out an API by looking at the source.

The URL is useful although I'll look at it at home since my company's firewall is blocking that port right now and I don't feel like setting up a tunnel...
Thanks for help.
(Reply) (Parent) (Thread)
From: bobert225
2002-03-28 03:03 pm (UTC)
I don't know if you've already seen this or not, but it could be very helpful:
http://goathack.livejournal.org:8006/doc/hack/csp.xml-rpc.protocol.html

-bobert
(Reply) (Parent) (Thread)