Skip to content

Instantly share code, notes, and snippets.

@lele85
Created June 1, 2009 13:35
Show Gist options
  • Save lele85/121405 to your computer and use it in GitHub Desktop.
Save lele85/121405 to your computer and use it in GitHub Desktop.
wordpress_comment.py
import xmlrpclib
class comment:
def __init__(self, content, author, author_url, author_email, comment_parent = 0):
self.comment_parent = comment_parent
self.content = content
self.author = author
self.author_url = author_url
self.author_email = author_email
blog_id = 0
username = "py-xmlrpc"
password = "pythonexample"
post_id = 15
newcomment = comment("Hello world", "py-xmlrpc", "http://lele85.netsons.org/blog", "anybody@anywhere.com")
server = xmlrpclib.ServerProxy('http://lele85.netsons.org/blog/xmlrpc.php')
server.wp.newComment(blog_id, username, password, post_id, newcomment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment