Support » Plugin: Extended API » [Plugin: Extended API] Usage

  • Resolved meira

    (@meira)


    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.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Extended API] Usage’ is closed to new replies.