?

Log in

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

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

Adding tags to an xml-rpc postevent [Oct. 25th, 2006|01:38 pm]
LiveJournal Client Discussions
lj_clients
[seasontowers2]
Hi all,

I'm developing a web based client (in ASP) for my LJ, which allows people to post entries to my journal even if they don't have a LJ account. I'm using the XML-RPC method to do this, and have it posting new entries fine. However, I can't find anything in the documentation about adding tags to posts. Can someone point me in the right direction? Or failing that, tell me how?

I know it can be done, since I've seen standalone clients that can do it. I don't even need to dynamically get the available tags, since it's only ever posting to my LJ, and I know what tags I have. I just need a way of attaching tags to a post.

Thanks,
Ben.
linkReply

Comments:
(Deleted comment)
From: seasontowers2
2006-10-25 03:10 pm (UTC)
That looks promising. I'm unsure how to format the props item(s) in my request though. I'm using the example from the documentation (here), and it works fine for posting the post with a subject and time stamp.

I then tried adding the prop_taglist entry like so:


<methodCall> 
  <methodName>LJ.XMLRPC.postevent</methodName> 
  <params> 
    <param> 
      <value> 
. . . . . . . . . . . . condensed . . . . . . . . . . . . .
          <member> 
            <name>hour</name> 
            <value> 
              <int>20</int> 
            </value> 
          </member> 
          <member> 
            <name>min</name> 
            <value> 
              <int>35</int> 
            </value> 
          </member> 
        </struct> 
<member>
<name>prop_taglist</name>
<value>
<string>mytag,mysecondtag</string>
</value>
</member>
      </value> 
    </param> 
  </params> 
</methodCall> 


But it doesn't work. Anyone have any ideas how I actually format the props part of the request?
(Reply) (Parent) (Thread)
[User Picture]From: ralesk
2006-10-25 06:40 pm (UTC)

I use the flat protocol, but all I send is pretty much that, too: I’m sending the urlencode of {'prop_taglist':comma_separated_list_of_tags}.  Works for me :)

(Reply) (Parent) (Thread)
From: seasontowers2
2006-10-25 11:28 pm (UTC)
Thanks ralesk - I think I'm gonna switch to the flat protocol. I like the theory of xml-rpc, but it just seems very inneficient, and lacks some documentation.

I can get it to work in the flat protocol, so that's the way I'll go...
(Reply) (Parent) (Thread)
[User Picture]From: misterwan
2006-12-05 01:51 am (UTC)
For xml-rpc, you should use a "props" array and include a "taglist" element there:

http://www.sixapart.com/developers/product_documentation/livejournal/ljxmlrpcpostevent.html
(Reply) (Parent) (Thread)