iron-blogger/update-participants.py

29 lines
697 B
Python
Raw Normal View History

#!/usr/bin/python
import render
import os
import sys
import xmlrpclib
import subprocess
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
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')
page['description'] = text
x.wp.editPage(BLOG_ID, PAGE_ID, USER, passwd, page, True)