21 April 2010 17:22
I read an article over at OS X Daily about posting a tweet from the command line using the twitter API. Taking this one step further here’s a handy little script that’ll even stop you posting nothing and stuff that’s too long.
#!/bin/bash
TWEET=$1
TWEETLEN=${#TWEET}
if [ $TWEETLEN -eq 0 ] || [ $TWEETLEN -gt 140 ]; then
if [ $TWEETLEN -gt 140 ]; then
let EXTRA=$TWEETLEN-140
echo "Usage: tweet \"message\" (140 chars or less, you're $EXTRA over)"
else
echo "Usage: tweet \"message\" (140 chars or less)"
fi
exit 1
else
curl -u username:password -d status="$1" http://twitter.com/statuses/update.xml
fi
exit 0
Save the file as “tweet” and make sure it’s in the path with executable permissions of 755.
chmod 755 tweet
Filed: Technology // Tagged: bash, scripts, twitter //
2 April 2009 20:46
My preferred desktop twitter client right now is the excellent DestroyTwitter. It’s got everything your need and is pretty nifty all round.
In the latest beta you can customise the themes and as I was messing about with a few things I’ve created one for me that’s based on the scheme of this site. If you like those colours then you can grab the theme file. Just double click it and it should install.
Here’s a little more about DestroyTwitter:
DestroyTwitter is a robust but compact Twitter application built to run on Mac, Windows, and Linux using Adobe AIR. It consists of a series of canvases that constantly update to keep tweets current and up-to-date using notifications that appear immediately after a new tweet arrives. DestroyTwitter also features complete direct messaging functionality. Messages and tweets can be replied to with the original visible for quick and easy reference. A search function is also available to track anything that’s being talked about.
Filed: Personal // Tagged: design, themes, twitter //