Adding comments via a client with XML-RPC?

May 12, 2008 01:09

Hi! I'm writing a LiveJournal client using the XML-RPC interface. What I can't seem to find in the documentation (and it may not exist) is a way to use XML-RPC to add comments to Friends entries, or even the authenticated user's own journal. The latter is actually more interesting to me -- to be able to reply to comments in your own journal ( Read more... )

client, client: xmlrpc

Leave a comment

Comments 6

pauamma May 12 2008, 11:30:42 UTC
Yep, looks like there's nothing there - have you checked the Atom or Blogger APIs, though? (If those wouldn't work either, you may want to suggest/offer this as a LJ Labs project.)

Reply

professormass June 18 2008, 15:34:56 UTC
I may do just that -- none of the APIs allow for remote commenting.

I'm now stuck on one issue. I've used the form sent out via comment emails as a basis, but I'm having a hard time generating the ECP hash.

In talklib.pl, the hash is generated like so:

sub ecphash {
my ($itemid, $talkid, $password) = @_;
return "ecph-" . Digest::MD5::md5_hex($itemid . $talkid . $password);
}

In PHP, I'm doing this:

$TalkID = '1010';
$ItemID = '010101';
$Password = 'mypassword';
$ECPHash = md5($ItemID . $TalkID . $Password);

However, the submitted form is rejecting the hash as having the wrong password. Is there some further munging of the password that needs to be done to generate a valid password for hashing? Or is the PHP md5() doing something different than the Perl library?

Any clues?

Reply

pauamma June 18 2008, 16:22:12 UTC
Try comparing what the perl code and your PHP code give you for the same data?

Reply

professormass June 18 2008, 16:33:13 UTC

They come out with different ECP hashes.

Now, I know the TalkID and the ItemID aren't the problem, which leaves me with one of two options:

1) The MD5 hashing functions work differently between PHP and Perl (which would be odd).

2) The password being used to generate the hash on LJ's side is not a clear-text password, but rather some sort of encrypted form of the password being pulled from their database.

Any thoughts?

Reply


Leave a comment

Up