Code Shop

Code Shop

Abhi Yerra  //  An entity composed of reality and pseudo-reality who enjoys coding, news, photography and wasting time.

Oct 1 / 10:21pm

Simple Vim Posterous Plugin

I like writing in Vim! It is one of those things that I am so used to
that every other text editor feels unnatural and going against the
grain. So I thought I'd write a small plugin to post to Posterous. Add
the following code to your .vimrc. Also make sure you have python
enabled in vim as well as have markdown2 for python installed.

The following need to be changed: blog_email, blog_password, and
site_id. site_id can be grabbed by running the following on the
terminal:

 
curl -u my@email.com:mYpA$$W0RD http://posterous.com/api/getsites 

Substitute the email and password. You will get a list of your blogs
so choose the id of the blog you want to post to.

The format of the text should be as follows: the first line is the
title and the proceeding lines are the body:

 
This is the title of the post 
 
This is the body of the post. 

This code is pretty straightforward and sparse because I am using this
to post code snippets to a private blog. Check out the Posterous API to add more
options and whatnot. Also take this as a start and expand upon it.

1 comment

Oct 11, 2009
Can a plugin for LiveWriter or ScribeFire be possible with this API?

Leave a comment...

 
Got an account with one of these? Login here, or just enter your comment below.
Posterous-login    Connect    twitter