Professor Mass ([info]professormass) wrote in [info]lj_dev,
@ 2008-05-12 01:09:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current mood:chipper

Adding comments via a client with XML-RPC?
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.

Is that possible? Am I missing something? The only other way I could see to do this would be to basically do a POST request to talkpost_do.bml, but that seems clumsy.

Any thoughts or help would be appreciated.



(Post a new comment)


[info]pauamma
2008-05-12 11:30 am UTC (link)
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 to this)(Thread)


[info]professormass
2008-06-18 03:34 pm UTC (link)
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?

Edited at 2008-06-18 03:35 pm UTC

(Reply to this)(Parent)(Thread)


[info]pauamma
2008-06-18 04:22 pm UTC (link)
Try comparing what the perl code and your PHP code give you for the same data?

(Reply to this)(Parent)(Thread)


[info]professormass
2008-06-18 04:33 pm UTC (link)

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 to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…