Muffinresearch Labs by Stuart Colville

Twitter from TextMate | 26 Comments

Posted in Code, humour on 20th March 2007, 9:18 am by

Yep I know what you’re all thinking this is insane, a Twitter Bundle? Actually it’s not much of a bundle seeing as it only allows you to do one thing at the moment and that’s to update your status.

An idea brought to you from the freakish depths of Christian Heilmann’s crazy mind and realised by yours truly. On reflection does make some sense as now you can send twitters from TextMate it looks like you’re working!

Simply download the Twitter Bundle, unpack and double click to install the bundle. Before you can twitter you need to configure the update status command with your username and your password. The Twitter API simply uses basic auth to allow you to post new messages.

Once you have it set up, simply type some text, select and press option+t ctrl+command+t to send it to Twitter (Note: If this conflicts with anything you can change this to a key combo of your own choosing in the bundle editor). Currently you get the full response back in a tooltip but I hope to improve on this in due course. By full response I mean the whole xml reponse in all it’s geeky goodness. Now you get sensible message to say a twitter has been sent. See I told you this was nuts.

Use at your own risk. I am not responsible if you bring Twitter to it’s knees (oh hang on it already is!). Uses PHP CLI, if you don’t have PHP on your mac you’re kinda screwed (but I think macs do by default so you should be ok). If you have probs let me know and I might be tempted to re-write it in C, or something else.

Rants, comments and suggestions for improvement are welcome below. Bonus points for silliness.

Versions

Version 0.2
Moved to a shell script. Send from window available. Changed default command to Ctrl+Command+t
Version 0.1
Original Release

Todo:

  1. Run update status script from the background to prevent hanging TextMate
  2. Publish the command to show the public/friends timeline

Fear not a more comprehensive version is in the works! :-)

Post Tools

GNU screen: open tab in current working directory|(1)

A nice trick for having screen open a new tab in the same directory as the one you’re currently in. To use it add it to your .screenrc

# Open new window in current dir.
bind c stuff "screen -X chdir \$PWD;screen^M"
bind ^c stuff "screen -X chdir \$PWD;screen^M"

Hat tip: mteckert on SuperUser.com

Ubuntu: add-apt-repository: command not found|(3)

When you’re using a minimal Ubuntu install if you find the ‘add-apt-repository’ command is missing (it’s useful for adding PPAs and other repositories), then simply run:

sudo apt-get install python-software-properties

Photos on Flickr

© Copyright 2004-12 Stuart Colville, all rights reserved. May contain traces of Muffin. Powered by WordPress. Hosting by Slicehost.com This page was baked in 0.553s.