turbolaserguy (turbolaserguy) wrote in memedev,
turbolaserguy
turbolaserguy
memedev

Error while using XML-RPC

  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 3 comments
Any luck figuring this out? I'm hitting the same roadblock. In my code, "password" is highlighted in blue - some kind of reserved word? I don't know how to escape it. (new to AppleScript)

Watching the network traffic, it looks like it's sending "RApw" instead of "password":

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>LJ.XMLRPC.postevent</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>RApw</name>
<value>
<string>mypassword</string>
</value>
</member>
<member>
<name>username</name>
<value>
<string>quill18</string>
</value>
</member>
<member>
<name>auth_method</name>
<value>
<string>clear</string>
</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>
The blue text indicates a scripting addition conflict that you eliminate by putting the label in |pipe| characters, see my comment elsewhere in the thread.
I think you're sending multiple parameters when LJ calls for a single struct parameter. I've been playing around with interfacing AS to LJ myself, your code should end up looking something like the following. Remember to |pipe| the record labels to prevent scripting addition conflicts.

tell application "http://www.livejournal.com/interface/xmlrpc"
        set x to call xmlrpc {method name:"LJ.XMLRPC.postevent", parameters:¬
                {{username:"silvermeteors", auth_method:"clear", |password|:"MYPASSWORD", |event|:¬
                        "I posted this directly from AppleScript using LiveJournal's XML-RPC API. Kickass.", lineendings:¬
                        "mac", subject:"I'm Awesome!", security:"", allowmask:0, |year|:¬
                        2005, mon:8, |day|:14, hour:4, min:17}}}
end tell
get x
-- {anum:184, |url|:"http://www.livejournal.com/users/silvermeteors/87736.html", itemid:342}