I was doing some stuff on the Drupal blogapi and noticed that they have changed the interfaces slightly in a way that broke an old favorite posting. The newPost and editPost functions now take a node type as a first argument instead of a blank string.
Here is updated code:
1 def PostBlog(): 2 import xmlrpclib 3 import re 4 5 # 6 # If first line contains a blog entry ID then edit existing post, 7 # otherwise write a new one. 8 # 9 nFirstLine = 0 10 strID = vim.current.buffer[0] 11 if not re.match( '^\d+$', strID): 12 strID = '' 13 else: 14 nFirstLine = 1 15 16 strTitle = vim.current.buffer[nFirstLine] 17 strText = "\n".join( vim.current.buffer[nFirstLine+1:]) 18 19 oDrupal = xmlrpclib.ServerProxy( strDrupal + '/xmlrpc.php') 20 21 oPost = { 'title': strTitle, 22 'description': strText} 23 24 if strID == '': 25 strID = oDrupal.metaWeblog.newPost( 'blog', strUserName, strPassword, oPost, 1) 26 else: 27 bSuccess = oDrupal.metaWeblog.editPost( strID, strUserName, strPassword, oPost, 1) 28 29 print "Posted entry %s" % strID 30 31 # 32 # Don't intend to write posts to disk so unmodify the buffer and 33 # allow easy quit from VIM. 34 # 35 vim.command( 'set nomodified') 36 37 def ReadBlog( strID = None): 38 import xmlrpclib 39 40 oDrupal = xmlrpclib.ServerProxy( strDrupal + '/xmlrpc.php') 41 if strID: 42 oBlog = oDrupal.metaWeblog.getPost( strID, strUserName, strPassword) 43 else: 44 oBlogs = oDrupal.metaWeblog.getRecentPosts( 'blog', strUserName, strPassword, 1) 45 oBlog = oBlogs[0] 46 strID = oBlog['postid'] 47 48 vim.current.buffer[:] = [] 49 vim.current.buffer[0] = strID 50 vim.current.buffer.append( oBlog['title']) 51 vim.current.buffer.append( '') 52 for strLine in oBlog['description'].split('\n'): 53 vim.current.buffer.append( strLine)Toggle Line Numbers
Instructions here.
If you can read this then it is working again.


Hi, I'm just here to test your Captcha module. Feel free to delete this comment.