[resolved] XMLRPC posting (8 posts)

  1. Ashfame
    Posted 5 years ago #

    How can I post through XMLRPC in WordPress using PHP?

    I need full fledged functionality. Please point in some direction.

  2. MichaelH
    Posted 5 years ago #

  3. Ashfame
    Posted 5 years ago #

    Thanks for the link Michael! Didn't find that at first.

    Looking forward to more resources (I like the one with examples :P)

  4. MichaelH
    Posted 5 years ago #

  5. MichaelH
    Posted 5 years ago #

  6. Ashfame
    Posted 5 years ago #

    Thanks for the link! 3rd one, that was I wanted exactly.

    Get around with someone who does it every now and then ;)

  7. tonybaldwin
    Posted 5 years ago #

    The Codex page doesn't give information on how to send a post request (has everything else, like editing categories, to adding media...but no post request...hello!).

    Trying to do that in Xpostulate (tcl/tk blog client), like this:

    proc wppost {} {
    set content [.txt.txt get 1.0 end]
    set escaped [string map {
    	"<" "<"
    	">" ">"
    	\"  "\""
    	} $content]
    .txt.txt delete 1.0 end
    .txt.txt insert insert $escaped
    set ptext [.txt.txt get 1.0 {end -1c}]
    set time [clock format [clock seconds] -format %G%m%dT%T]
    global mypost
    set mypost "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
    <member><name>dateCreated</name><value><dateTime.iso8601>$time</ dateTime.iso8601></value></member>
    set plength [string length $ptext]
    set dopost [http::geturl http://$::wpname.wordpress.com/xmlrpc.php -query $::mypost -type "text/xml" ]
    set wpstat [http::status $dopost]
    set wpresponse [http::data $dopost]
    toplevel .rsp
    wm title .rsp "Post Status"
    frame .rsp.btns
    grid [tk::label .rsp.btns.lbl -text "WP says: $wpstat\nPost length: $plength"]
    grid [tk::button .rsp.btns.view -text "View Journal" -command {
        set wpu "http://$::wpname.wordpress.com"
        exec $::brow $wpu &
    [tk::button .rsp.btns.ok -text "DONE" -command {destroy .rsp}]
    frame .rsp.txt
    text .rsp.txt.t -width 80 -height 20
    .rsp.txt.t insert end $wpresponse
    pack .rsp.btns -in .rsp -side top -fill x
    pack .rsp.txt.t -in .rsp.txt -side top -fill x
    pack .rsp.txt -in .rsp -side top -fill x

    Getting this response:

    <?xml version="1.0"?>
              <value><string>parse error. not well formed</string></value>

    I am successfully posting to livejournal, dreamwidth, and other Lj clones using the xmlrpc method, but not finding good documentation on the difference between an LJ post and a WP post.
    Clearly, some LJ props (current_mood, current_music) are not relevant, etc.
    The above xml attempt is based on info from http://msdn.microsoft.com/en-us/library/aa905673.aspx

    Any idea where my xml is malformed?
    Am I missing a relevant or required variable?
    Any ideas?


  8. Joseph Scott
    Posted 5 years ago #

    @ tonybaldwin -

    Please don't repost the same question across multiple threads, it makes it hard to follow along. I replied here - http://wordpress.org/support/topic/386185?replies=3#post-1472008

Topic Closed

This topic has been closed to new replies.

About this Topic