?

Log in

No account? Create an account
This Is Who I am and What I want to do - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

This Is Who I am and What I want to do [Jul. 20th, 2004|11:08 am]
LiveJournal Client Discussions

lj_clients

[fbartho]
[mood |ecstaticecstatic]
[music |[the sound of computer fans and people working in an office]]

Well it turns out that I have known about livejournal for a good number of years now... I have always been a big fan but I never got around to joining until a relatively short while back... My reason for joining was to access friend's only blog posts... About 1.5 years ago-Spring 2003-(sheesh time flies) I started learning php and wrote myself a very rudimentary blog system nearly purely from scratch with simple text files I uploaded and parsed... It was fun, and was fitting into the site I was working on at the time... That was my senior year in HS and then I went off to College 1st semester worked on it some but not really I had too many things to do... This summer I get a good job... ponder the decision and decide the time has come to get my own domain name... http://www.digitalsneeze.com" [incredibly underconstruction]

Suddenly my interest and activities in webprogramming, php and programming in general skyrocket once again and I have a million and one ideas... I start a phpbb2 forum among tons of other ideas, I start reading my friends ljs more and more and I realize that my old blog just doesnt cut it and that I might as well add another project: an lj interface from my site...

What I am planning to do: modify my forums such that there is a section for the user's lj have the site fecth the data from the journal, have it parse the data and present it as i choose, and of course I cant take the easy route and just have the RSS feed... though I may still use it... I think I want to implement posting, editing, commenting, maybe friends as well. I am a big fan of php and what I have googled on the topic leads me invariably to this community, (along with livejournal pages pointing here) or to XML-RPC

What I am wondering is whether there are any packages already written that will fetch the data for php I know there are some that will do this for perl but well my knowledge of that is what I have learned while rapidly hacking towards an AIM bot (project also started this summer) I have also googled and found http://phpxmlrpc.sourceforge.net/ but what concerns me is the seeming lack of work on that project... That and also http://finalstand.archsysinc.com/ but this last will have to serve as a starting point unless i hear otherwise due to its current state of development.

Well at this point I have written a good amount and so I am going to stop... heh Sorry about that, this is actually my first non-comment post on LJ and if this project goes well, then it will definitely not be the last... (I actually intend to put my first post in right after this :D )

[my name:] Frederic Barthelemy
linkReply

Comments:
[User Picture]From: vanbeast
2004-07-20 05:08 pm (UTC)
PHP's built-in XML-RPC stuff works really well, particularly with LiveJournal's XML-RPC interface. I've written some stuff in PHP using it, it was quite nice.

Just a comment on that in passing :)
(Reply) (Thread)
[User Picture]From: fbartho
2004-07-20 06:00 pm (UTC)

Sounds like a good enough endorsement for the livejournal xml-rpc protocol as any in my mind... I mean I was kindof hoping I wouldn't have to write my own methods for posting and commenting, I mean I could always just route the users on to the livejournal comments page... but thats too easy heh... I wanna be lazy but have something hard... hehe... (I've never liked playing with forms and retrieving data from them myself... but ah well...) Random thought of mine is that with this method I can have my current blog entry brought into my AIM subprofile... cool!
(Reply) (Parent) (Thread)
[User Picture]From: vanbeast
2004-07-20 06:26 pm (UTC)
The neat part of PHP's built-in XML-RPC is that you basically just build a data structure that matches the kind LJ is expecting, serialize it using the XML-RPC functions, and send it.

It converts between PHP types and XML-RPC types automatically, so it's really, really easy.

One thing you'll find, though, is that it's not possible to post comments remotely. You'll have to send people to the actual entry page.
(Reply) (Parent) (Thread)
[User Picture]From: fbartho
2004-07-20 07:28 pm (UTC)

what?

What? Not Possible to post comments remotely?? Why not? Wouldn't that just be a subset of a post? [Am Talking as if I wrote it, i havent examined the code yet]
(Reply) (Parent) (Thread)
[User Picture]From: ibneko
2004-07-20 09:25 pm (UTC)

Re: what?

::frowns:: I'm sure it could be done, at least in perl, using the LWP::UserAgent mod. Just get something that'll log all requests (iCab for me~ or use a packet sniffer) and look at the POST request, then mimic that. I haven't learned php, but if I recall, there was something similar to LWP::UserAgent... I hacked Pivot a while ago to make it crosspost entries to livejournal. Eh, yeah curl, I believe it was? Lemme try to write up something to post a comment to livejournal using perl, give me a second....

(Gonna be harder to do threaded comments... in that case, you may need to keep a local copy of the comments already posted (so users can see what you're replying to), and then you might as well send users to the livejournal page itself... [/end random side ramble])
(Reply) (Parent) (Thread)
[User Picture]From: ibneko
2004-07-20 10:08 pm (UTC)

Re: what?

Hah! Yep, done~
http://darwin.servehttp.com/livejournal_comment.bml

Current, it only posts anonymously, and only to that entry. Mmm, there's some other restrictions livejournal has worked in. I was able to post a comment the first time without hitting an "Prove you are human" page. Seem's you might be limited to one comment per post per IP per set period of time? Unless you have your users log in. Then there shouldn't be any restrictions, if I recall correctly. There was a discussion about this a while ago, you may want to check

Nevermind that, I searched: http://www.livejournal.com/community/lj_backend/2913.html

So you might have to make a livejournal account that's called "anonymous remote comments" and use that instead, to make sure your users don't hit that sort of problem.

(as for the page I first mentioned... it currently posts to http://www.livejournal.com/users/ibneko/200001.html. The first chunk of code below the form shows the source code of that entry/post-a-comment page(link with ?mode=reply). The second chunk of code is the perl code (html-ified) that powers the page.)
(Reply) (Parent) (Thread)
[User Picture]From: fbartho
2004-07-21 05:44 am (UTC)

Re: what?

hmmmm... well I guess that would be a solution... what if i had the comment post emulate the lj page comment post? soo the user would find themselves on the official comment page after (unless i played with opening a new window and then closing it...) but then the anonymous post would come from their ip? That would bypass the anonymous rate limit... and it would house the comment setup on my website... of course that is assuming that I can fetch the comments... which i can right?
(Reply) (Parent) (Thread)
[User Picture]From: ibneko
2004-07-21 08:24 am (UTC)

Re: what?

Emulate... as in grab the lj page, modify some to make it look the way you want, then pass it onto the user? That's actually what I'm doing there... 'cept I'm stripping out practically all of the page, then setting up the form so that it the form sends the users to the official do-comment page (talkpost_do.bml). So: User, request->Your Server
Your Server, get page->LiveJournal
Your Server, parse page, fix, whatever, then send back to->User
User, sends comment in POST talkpost_do.bml request->Livejournal
LiveJournal, sends official Comment Posted page->User

Granted, you _could_ also do:
User, request->Your Server
Your Server, get page->LiveJournal
Your Server, parse page, fix, whatever, then send back to->User
User, sends comment in GET/POST request->Your Server
Your Server, passes comment->LiveJournal
It certainly gives you more control with where the users go... as with the former, users will have to rely on the back button to go back to your site. I think you could probably make an invisible frame that'll bring the users back though? I dunno. May not be a problem if all of your users are techie enough to know they were sent offsite. (as opposed to someone like my mom who would be very lost and confused. XD)

And yes, since each user would have his or her own IP, unless they are posting comments more than once a minute, they won't have problems. Even then, they'll just hit livejournal's prove-that-you-are-a-human page, and that shouldn't pose too much of a problem for most, unless they're both deaf and blind...

And yes, you can fetch the comments. PHP equiv:
$ch = curl_init("http://www.livejournal.com/['users' or 'community']/[username]/[entryid].html");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$buffer = curl_exec($ch);
curl_close($ch);


Umm. I assume it's returned in $buffer. I dunno, I've never used php to read site responses.. only done it in perl. I'm sure you can figure it out with a quick google serach though.
(Reply) (Parent) (Thread)
From: snej
2004-07-22 02:23 pm (UTC)

Re: what?

People like me have been yelling for this for years. There are a lot of things that can't be done through anything but the web forms -- primarily any access to comments.
(Reply) (Parent) (Thread)
[User Picture]From: fg
2004-07-20 06:26 pm (UTC)
i have to add a second vote for XML-RPC.

it's pretty easy to use.
(Reply) (Parent) (Thread)