Posting to WordPress with Python and MetaWeblog API
The author of the blog Vizible has written a short Python script that shows how to use the programming language to post a weblog entry to WordPress using the MetaWeblog API:
import xmlrpclib
user = 'username'
passwd = 'password'
server = xmlrpclib.ServerProxy('http://example.com/xmlrpc.php')
blog_id = 0
title = 'test title'
content = 'test content, from python'
blog_content = { 'title' : title, 'description' : content }
categories = [{'categoryId' : 'programming', 'isPrimary' : 1}]
post_id = int(server.metaWeblog.newPost(blog_id, user, passwd, blog_content,0))
server.mt.setPostCategories(post_id, user, passwd, categories) # not work
server.mt.publishPost(post_id, user, passwd)