?

Log in

No account? Create an account
Writing a PHP client for posting to Livejournal - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

Writing a PHP client for posting to Livejournal [Mar. 8th, 2007|01:48 am]
LiveJournal Client Discussions

lj_clients

[kosso]
Hi,
I have a system which crossposts to other systems and I am having trouble making a correct post to LiveJournal (btw: the system is for Second Life at http://bloghud.com )

I am able to list users blogs and get the required data to make posts on their behalf and also I am able to make 'a post' -

but the post itself show up as something like : HASH(0xbeb4544)

see: http://kosso.livejournal.com/1446.html

Which makes me think that my content struct is malformed - despite not giving an error.

This is what I am trying to post:

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
  <methodName>blogger.newPost</methodName>
    <params>
      <param>
        <value><string>0123456789ABCDEF</string></value>
      </param>
      <param>
        <value><string>kosso</string></value>
      </param>
      <param>
        <value><string>kosso</string></value>
      </param>
      <param>
        <value><string>xxxxxxxx</string></value>
      </param>
      <param>
        <value>
        <struct>
            <member>
                <name>title</name>
                <value>
                <string>this is a test post title</string>
                </value>
             </member>
             <member>
                <name>description</name>
                   <value>
                  <string>here is the main body of the post. very interesting I think you'll agree</string>
                   </value>
             </member>
        </struct>
        </value>
      </param>
      <param>
        <value><int>1</int></value>
      </param>
  </params>
</methodCall>

I'm posting to the http://www.livejournal.com/interface/blogger endpoint

This is beyond the (limited) documentation over at : http://www.sixapart.com/developers/xmlrpc/blogger_api/bloggernewpost.html

as this only shows how to post to the main body of the post. (ie not as a title/description  or  subject/body ) which I have got working.

So, can anyone out there explain how to create a content struct to contain the title and description?

(I'm new to LJ's system and I have to say the documentation is terrible. This is also why I'm having trouble support MT too)

I was even able to write support for the new Google/Blogger Account system, which wasn't fun at all, so I thought this might be easier.

Any help with this would make many happy users ;)
Cheers!
koz

ps: is this searchable? I cant see a search field to look for previous posts on this subject. thx. *rubs eyes*
linkReply

Comments:
[User Picture]From: int
2007-03-08 06:36 pm (UTC)
The flat/XMLRPC methods will be around forever. Nearly every LJ client uses one of the two, and they still get features added to them now and again.
(Reply) (Parent) (Thread)