Twitter from the command line with tweet

This is a stupidly simple script for sending microblogs to twitter.com using curl and spell checking them with aspell along the way. it looks like this:


#!/bin/bash
# tweet - A command line twitter with spellcheck - me@phrog.org
echo $@ > /tmp/tweet
aspell -c /tmp/tweet
TWIT=$(cat /tmp/tweet)
curl -u USERNAME:PASSWD -d status="$TWIT" http://twitter.com/statuses/update.xml
rm /tmp/tweet
exit 0

Save the code as “tweet” and use it like this:

you@yourprompt:~$ tweet testing my tweet script

It should spit out some success xml. You just sent a tweet to twitter.

Of course you will need to edit the USERNAME and PASSWD to your username and password at twitter.com. If you don’t like copy and paste you can grab it as a file here. Hope you find it useful.

One thought on “Twitter from the command line with tweet

  1. If you get a ‘command not found’ check to make sure that you have curl and aspell installed.

    Also, any punctuation (apostrophes, exclamation points, etc) must be enclosed in quotes.

    Happy tweeting 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *