Improvements to the Vim drupal blogging client

06 Jun 2008

Posted by acrollet

I've made a few improvements to my Drupal blogging client, first spoken about here. It now has the ability to publish and unpublish posts, delete posts, and create and edit free tags (folksonomy). The free tagging feature requires a module that I've packaged up for parsing tags in the post body - just waiting on permission from the author of the sample code I modified before posting that. Hopefully it'll be coming soon!

There are two new commands - :PublishPost and :SavePost. (:w still publishes a post, as before) Unfortunately, the drupal blogapi does not expose whether a post is published or not, so I had to resort to modifying the post title to show the post status. Hacky, but it works!

I ran across a couple of very nice tools for working with xmlrpc while I was trying to get this all to work. First off is a great little tool called XML-RPC Client - it's just a Mac Os X (Cocoa) tool that lets you make an xmlrpc call, view the generated xml, and view the returned results as xml and a struct.

Second, I found this proxy script written in python - it made debugging much, much easier...

Without further ado, here is the newest version of drupal_blog.vim. As before, you will need to apply add1sun's patch from http://drupal.org/node/224006 to make the blog API work basically at all, and you'll need my patch from http://drupal.org/node/243907 for file/image uploads to work.

Comments

This is so cool!

However, i get this error:

Traceback (most recent call last):
File "", line 1, in
File "", line 156, in GetPosts
TypeError: bad argument type for built-in operation

I wasn't able to determine the exact problem but i wonder if it is caused by UTF-8 chars in my post titles?

Cheers,
Jakub


Yes, I was right. Change the for to:

vim.current.buffer.append( post['postid'] + ': ' + post['title'].encode('utf8') )

and it works...


Here is my patch to your client, fixing:
1) one syntax error you had
2) utf8 strings everywhere

now editing/newposts/listing works with UTF8 characters too...didn't test uploading files...

http://temp.jakubsuchy.cz/drupal_blog.vim.patch


thanks much for rolling a patch - I applied it and briefly tested it with my setup, all seems to be fine, so the version above is now utf8 ready! Also added some prettier exception handling for the case of a bad username/password when listing posts...


One more idea which i am not able to implement due to lack of proper Python knowledge :)

I know it's possible to post multiple content types using blogapi. What about changing command "e blog/something" to "e content_type/something". Therefore "e story" or "n story" would create a new story, "n page" would create a new page, etc. Simple "n" would still create a blog.


Glad to hear that the version above is now ready. This is the only place i could find it. Couldn't realize it such a great problem.


Hmm is anyone else encountering problems with the images on this blog loading? I'm trying to find out if its a problem on my end or if it's the blog. Any suggestions would be greatly appreciated.


Add new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.