My Microblogging tool is coming together. This is my vision for a blogging tool that is:
-
Fast to post with so posting is as lightweight as possible
-
Supports tagging to organise the posts. I have decided that tagging is preferable to putting articles in a rigid tree hierarchy.
I decided on the following architecture:
-
VIM as an editor. For me this is by far the quickest way to do data entry
-
I create however many posts in an single page and post them in one go
-
I use Vim's python scripting to send the file full of posts to the server via an xmlrpc call
-
The server implements a python cgi script to process the file full of posts. It splits the files into seperate posts and submits them to Drupal one by one. Drupal is the backend database and is also a reporting tool.
Most of the processing is done by the cgi script. I could post directly from VIM to Drupal, post-by-post but the Drupal blogapi does not support awtags and I'd rather write some python to do it that struggle modifying the php code. The cgi script also supports reading back a days-worth of postings so I can also edit existing posts.
Using VIM I was able to create a nice syntax-highlighing definition to make the posts easy to edit. Here is an example of how it looks in VIM:
This is the title
23 August 2005 12:34
[some stuff]
This is a posting in Vim. I can create stuff in VIM much faster than I
can type it in textarea in a web browser.
As posts support basic html markup, html tags are <i>syntax highlighted</i>.
It will syntax-highlight python:
<python>
for i in range( 10):
print "Python rox"
</python>
It shows blocks with a green mark in the first column.
It will syntax-highlight php:
<php>
$strStr = "What is the dollar for?";
</php>
It marks out my verbatim blocks:
<verbatim>
This is preformatted.
</verbatim>
The format of the posts is a title line followed by date/timestamp and a list of tags, followed by the post itself, indented to delineate it. For me the syntax highlighting is the killer feature, I am almost word-blind without syntax highlighting. I stole the idea fromwas inspired by The Vim Outliner.
I won't post all the code here as it's too big to post inline and it is highly likely that nobody else is interested anyway. It's not quite finished, I still have a few issues to resolve:
-
VIM macros to help in posting, such as filling in the date.
-
Support for multiple blogs: work blog, personal note blog and this blog. How to cross post?
-
Any way to handle images/attachments?
I call it the Microblog, micro to emphasise the fine-grained nature: not big laborious articles (like this one) but short pithy notes.