Skip navigation

Category Archives: Bash

There are many reasons you might want to tweet from the shell. Mine is that I want to be able to send one-liners in to evernote directly from terminal. I looked it up and found that since Twitter has updated to using Oauth for their API this has become much more diffucult. But there is a work around that doesn’t involve using oauth libs.

Enter Super Tweet: They provide a proxy to the twitter API which allows you to still use basic authentication to send tweets. You can sign up here: http://supertweet.net .

Once you have a Super Tweet account set up, create an auth file in your home directory with your Super Tweet account info as fallows:

username:password

Resist the urge to call your auth file something like “twitter_password” and make  sure to change the premissions so that only you can view it. I called my file “.twitter_a”.

Then just create this one line script:

curl -u `cat ~/.twitter_a` -d status="$*" http://api.supertweet.net/statuses/update.xml

You can now use the script like so:

./tweet.sh my awesome tweet goes here

This is all bare bones and it leaves a lot to be desired, but hey it works! Feel free to modify it and come up with your own uses for twitter in the CLI.

Hey just a quick tip.  I created a small script for generating passwords using http://makeagoodpassword.com/. The syntax is:

getpass

Gets a good password from makeagoodpassword.com

getpass simple

Gets a simple password from makeagoodpassword.com

Here is the code:

#/bin/bash
if [ "$1" == "simple" ]; then
wget -q -O - http://www.makeagoodpassword.com/password/simple/
else
wget -q -O - http://www.makeagoodpassword.com/password/strong/
fi