WordPress.org

Ready to get started?Download WordPress

Forums

Extended API
[resolved] Usage (6 posts)

  1. meira
    Member
    Posted 3 years ago #

    Works like a charm.

    Usage in Python :

    # Fetch november 2010 posts
     import xmlrpclib
     wp_site = 'http://my-wp-site.com/xmlrpc.php'
     server = xmlrpclib.ServerProxy( wp_site )
     loginname = 'myusername'
     password = 'mypass'
     method='get_posts'
     arg =['numberposts=100&offset=0&year=2010&monthnum=11']
     posts = server.extapi.callWpMethod(loginname,password,method,arg)
     print 'Find',len(posts),'posts:'
     for post in posts:  # get posts dictionaries list
        for k in post:  # get dict
           print k,":",post[k]  # print keys and contents

    Thist code fetch 100 posts in 10 seconds.

  2. michaelgrosser
    Member
    Plugin Author

    Posted 3 years ago #

    Glad to hear it! Please feel free to let me know if you have any suggestions for improvement.

  3. meira
    Member
    Posted 3 years ago #

    Access to $wpdb class would be fine, to make remote SQL requests...

  4. michaelgrosser
    Member
    Plugin Author

    Posted 3 years ago #

    That's a good idea, though it's significantly more involved than accessing the procedural functionals.

    I'll look into it for a future update for sure, as it would definitely open up things to outside access even further.

  5. mmtrav
    Member
    Posted 3 years ago #

    Is this offering what you want, Meira?

    http://www.coderstd.com/products/xmlrpc-api-wp/index.html

  6. StErMi
    Member
    Posted 2 years ago #

    Got an error using wp_signon

    someone know why?

    This is code: http://pastebin.com/wrJePTdJ

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic