Log in

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

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

Accessing Comments via PHP [Dec. 10th, 2005|08:26 pm]
LiveJournal Client Discussions



I'm working on my website, which grabs the XML feed of my journal and displays the posts there... I'm adding some AJAX into the mix (as you can see by clicking "drink the melanade" at http://www.bengarmisa.com/blog ) also. I'd love to be able to use AJAX to display comments underneath each post when someone clicks "see who drank the melanade." The problem with this is that the only way I can see to export comments is by using the comment exporting tool (using a php f_open call similar to "http://www.livejournal.com/export_comments.bml?get=comment_body&startid=maxid+1...")...

This poses a multitude of problems... The first being that I believe you need to login in order to view comments... I can't figure out a way to get PHP to send a cookie *to* livejournal.com... I've figured out how to use sessiongenerate to generate a session ID, but I don't know if there's any way to have PHP send that session ID back to the server...

The second problem that arises here is that the comment exporting tool only displays "jitemid" to reference which journal entry any given comment is linked to... The XML feed, however, only shows the UNIQUE journal entry id (a five digit number--the same number you see in every entry's permlink). I can't figure out any way to figure out how the jitemid and unique journal entry id correstpond, so even if I could get PHP to send the correct sessionid back to livejournal.com, the comment data I got back would be pretty much useless...

any ideas?

[User Picture]From: ibneko
2005-12-16 02:31 am (UTC)
Cookie eh... Hmmm, perl's LWP useragent + whatever module it was that handles cookies? I don't remember it off the top of my head - it's been too long since I've messed with it.
(Reply) (Thread)