2009-12-30 06:08:27 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
import render
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import xmlrpclib
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
2012-01-19 18:35:43 +00:00
|
|
|
XMLRPC_ENDPOINT = 'http://blog-URL.tld/xmlrpc.php' # Wordpress RPC-URL - e.g. http://chaosblog.wordpress.com/xmlrpc.php
|
|
|
|
USER = 'username' # wordpress-username
|
|
|
|
BLOG_ID = 0
|
|
|
|
PAGE_ID = 12
|
2009-12-30 06:08:27 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
subprocess.call(['stty', '-echo'])
|
|
|
|
passwd = raw_input("Password for %s: " % (USER,))
|
|
|
|
print
|
|
|
|
finally:
|
|
|
|
subprocess.call(['stty', 'echo'])
|
|
|
|
|
|
|
|
x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
|
|
|
|
page = x.wp.getPage(BLOG_ID, PAGE_ID, USER, passwd)
|
|
|
|
|
2009-12-30 06:26:54 +00:00
|
|
|
text = render.render_template('templates/users.tmpl')
|
2009-12-30 06:08:27 +00:00
|
|
|
page['description'] = text
|
|
|
|
|
|
|
|
x.wp.editPage(BLOG_ID, PAGE_ID, USER, passwd, page, True)
|