7f09576d40d701a538ebcd18dfca3c95647cc8b1
[iron-blogger] / update-participants.py
1 #!/usr/bin/python
2
3 import render
4 import os
5 import sys
6 import xmlrpclib
7 import subprocess
8
9 text = render.render_template('templates/users.tmpl')
10
11 XMLRPC_ENDPOINT = 'http://iron-blogger.mit.edu/xmlrpc.php'
12 USER            = 'nelhage'
13 BLOG_ID         = 1
14 PAGE_ID         = 16
15
16 try:
17     subprocess.call(['stty', '-echo'])
18     passwd = raw_input("Password for %s: " % (USER,))
19     print
20 finally:
21     subprocess.call(['stty', 'echo'])
22
23 x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
24 page = x.wp.getPage(BLOG_ID, PAGE_ID, USER, passwd)
25
26 page['description'] = text
27
28 x.wp.editPage(BLOG_ID, PAGE_ID, USER, passwd, page, True)
29
30 # Parameters
31 # int blog_id
32 # int page_id
33 # string username
34 # string password
35 # struct content
36 #   string wp_slug
37 #   string wp_password
38 #   int wp_page_parent_id
39 #   int wp_page_order
40 #   int wp_author_id
41 #   string title
42 #   string description (content of post)
43 #   string mt_excerpt
44 #   string mt_text_more
45 #   int mt_allow_comments (0 = closed, 1 = open)
46 #   int mt_allow_pings (0 = closed, 1 = open)
47 #   datetime dateCreated
48 #   array custom_fields
49 #     struct
50 #       string id
51 #       string key
52 #       string value
53 # bool publish

Benjamin Mako Hill || Want to submit a patch?