?

Log in

No account? Create an account
XML - LJ.XMLRPC.postevent - props member - LiveJournal Client Discussions — LiveJournal [entries|archive|friends|userinfo]
LiveJournal Client Discussions

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

XML - LJ.XMLRPC.postevent - props member [May. 18th, 2004|08:31 pm]
LiveJournal Client Discussions

lj_clients

[krolain]
[mood |confusedconfused]

Evening everyone.

I got another question (I hope I'm not bugging anyone too much) regarding the postevent through XML this time.

So far, it seems whenever I use this member I get an LJ XML parsing issue. So, I'm rather confused on how to use this member to set the various properties. Based on the document, I tried it these way so far:

<MEMBER>
  <NAME>props</NAME>
  <VALUE>
    <ARRAY>
      <DATA>
        <VALUE>
          <STRUCT>
            <MEMBER>
              <NAME>current_mood</NAME>
              <VALUE><STRING>curious</STRING><VALUE>
            </MEMBER>
           </STRUCT>
         </VALUE>
        <VALUE>
          <STRUCT>
            <MEMBER>
              <NAME>current_music</NAME>
              <VALUE><STRING>music</STRING><VALUE>
            </MEMBER>
           </STRUCT>
         </VALUE>
       </DATA>
     </ARRAY>
   </VALUE>
</MEMBER>


and I also tried it in this way:

<MEMBER>
  <NAME>props

So, both these things seems to get me a parsing error from LJ.  Are both these correct, or is there another way?  Is the document up to date on this?  I'm just a bit confused about this and getting a tad furstrated.  I even tried with just one prop and it fails.  I know my XML code work because I can do other things like log in and view, add, remove and edit my LJ groups and LJ friend lists.

Help would be appreciated.

Thanks everyone!
linkReply

Comments:
[User Picture]From: krolain
2004-05-23 06:16 pm (UTC)
Hi.

Thanks for the tip, but I tried it and it didn't work. It just doesn't like using special characters. I dunno why.

So, after many trials and error, I managed to figure it out how to do it. The best way is to encode the text into base64-encoded binary. I stumbled upon this answer when one of my post ended up being sent to me in binary. I knew it was text since it was a post that I used the same special character. Once I decoded the binary into bytes, then UTF-8 decoded that, the text appeared correctly.

So, the way to do it is:
1. UTF-8 byte encode the text
2. Encode the bytes into base64-encoded binary

That seems to work! :-) I may use base64 binary for all my text posting onto LJ.
(Reply) (Parent) (Thread)