|introduction and a question
||[Apr. 2nd, 2004|04:11 pm]
LiveJournal Client Discussions
New member here. I found this group while looking for a php interface to livejournal. I was planning on building one so that I can easily syndicate my main weblog to livejournal whenever I update the main weblog. I got tired long ago of copy/pasting to update both, and my content on LJ has suffered because of it
Before I get started developing a tool, I wanted to see what else is out there. I'm basically looking for something to accept user, password, subject, event and possibly mood and music that will create a post on lj. I would include this in my cms application to update livejournal whenever I update the weblog. My weblog is home-rolled, so I'm not looking for any sort of MT or Blogger plugin.
I haven't gone through all of the archives yet, just the most recent pages, and I haven't seen anything that jumped right out at me.
Can anyone point me in the right direction?
I'm not sure if what you're looking for already exists (I've got a feeling it does), but I can tell you this: developing an XML-RPC LiveJournal client in PHP is really easy.
PHP's built-in XML-RPC functions are perfect, you just build a data structure that matches what LiveJournal is expecting, serialize it, and send it. I think it took me about 20 minutes to get mine working.
I'm looking at this now as well.
you have to add that support to php though, correct? I'm not sure my host has that enabled.
I don't see --with-xmlrpc in my phpinfo().
Yeah, that's right. It doesn't require any external libraries, though, so my guess would be they'd be happy to add it in if you asked.
I'll ask them.
What about the flat interface? Could I use that?
You *could* use the flat interface, but it's going to be a lot more complex. You'll have to do raw requests and parse them blah blah blah. XML-RPC is the future.
One thing I remembered after I made my comment is that there are existing pure-PHP XML-RPC implementations... that is, classes you can use that don't require the extension. It's likely better to try to get your host to set it up for you, though.
I believe http://phpxmlrpc.sourceforge.net/
is one such implementation. There are others, I'm sure, and this one may not be the best, it's just the first I found from casual googling.
flat is just a regular HTTP POST (try making a web form with /interface/flat as the action) so it is probably even easier to do from PHP. Especially if you only want to push posts and not retrieve any data.
The XML-RPC is exactly the same, it's just a POST to /interface/xmlrpc
The difference is how you encode the data and decode the results.
All I'm doing is adding/updating/deleting data. I'm not pulling it down to display anything.
Well, you might be better off with the flat then. I'm a big proponent of completeness and re-usability, so if I were in your position I'd attempt to develop a generic access layer and then interface your program with it. But that's just me.
At the very least, you're going to want to check for success or failure, and I still think it'll be easier with XML-RPC :)
Absolutely. I'm really *not* looking for the easy way out.
I just wanted to see if someone had already developed something so I'm not reinventing the wheel here.
I'd rather use XMLRPC as well, and I'm talking with my host about it's availability.
2004-04-14 04:31 am (UTC)
I'm sorry, may I ask you to send me your PHP XML-RPC client to rych at scphys.kyoto-u.ac.jp? Or URL to download? What took you 20 minutes is going to take me a day as I don't have much experience.