diff --git a/update-participants.py b/update-participants.py index b47ef7c..20f4862 100755 --- a/update-participants.py +++ b/update-participants.py @@ -5,24 +5,21 @@ import os import sys import xmlrpclib import subprocess +import settings - -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 +config=settings.load_settings() try: subprocess.call(['stty', '-echo']) - passwd = raw_input("Password for %s: " % (USER,)) + passwd = raw_input("Password for %s: " % (config['username'],)) print finally: subprocess.call(['stty', 'echo']) -x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT) -page = x.wp.getPage(BLOG_ID, PAGE_ID, USER, passwd) +x = xmlrpclib.ServerProxy(config['xmlrpc_endpoint']) +page = x.wp.getPage(config['blog_id'], config['participants_page_id'], config['username'], passwd) text = render.render_template('templates/users.tmpl') page['description'] = text -x.wp.editPage(BLOG_ID, PAGE_ID, USER, passwd, page, True) +x.wp.editPage(config['blog_id'], config['participants_page_id'], config['username'], passwd,page,True) \ No newline at end of file