I wrote this script today morning before breakfast. It allows you to post to tumblr using the console. It’ll fire up vim to write a new post, and accepts markdown. If you don’t like vim, go away.
Here’s a snippet from the code. I’m testing out the new syntax highlighting system.
</p>
<h1>Instructions on how to use this file:</h1>
<h1>Step 1: set tumblr_email and password</h1>
<h1>Step 2: go to terminal, enter the two commands:</h1>
<h1>chmod +x tumblrpost.py</h1>
<h1>sudo cp tumblrpost.py /usr/bin</h1>
<h1>Step 3: Run tumblrpost.py from anywhere</h1>
<h1>You can use markdown to format your posts.</h1>
<h1>Ignore any errors. The post will still happen. Python seems to raise</h1>
<h1>errors with response code 201 is encountered</h1>
<h1>CHANGELOG:</h1>
<h1>==========</h1>
<h1>Version 0.1: Initial console version supporting regular posts</h1>
<p>import urllib, urllib2, os, subprocess</p>
<h1>TODO (user): SET THESE PARAMETERS</h1>
<p>tumblr_email = ''
tumblr_password = ''</p>
<p>if <strong>name</strong> == "<strong>main</strong>":</p>
<h1>Let's support only regular posts for now, but allow commandline</h1>
<h1>params to set post type later on. (like links, etc)</h1>
<p>post_type = 'regular'
if post_type == 'regular':
post_title=raw_input("Enter the title")</p>
<h1>Create a file for the body.</h1>
<p>filename = "post.txt"
editor = "vim"</p>
<p>
Anyways, you can see the full source code and download it here: http://code.google.com/p/proto-code-dump/source/browse/trunk/py/misc/tumblrpost.py
I’ll put my code on that repository, so if you want to get all my code, you can checkout the subversion repository:
http://proto-code-dump.googlecode.com/svn/trunk/

It’s good you decided to put up your code online. What is this syntax highlighting plugin?
I’d decided to put it online a long time ago, but I just got myself to do it now
It’s the syntaxhighligher plugin for wp. It’s based on the really pretty syntaxhighlighter, and does everything clientside.
I think the plugin’s misbehaving with my theme. Will look into this after midsems.
I believe the code indentation isn’t showing up properly. Must be the plugin.
hi, i think their is some problem including in step3.I don’t know whether i am properly executing the code or not.an you please explain me step3.