My Twitter from Command Line Bash Script
So you want to be able to nerd it up and show you're mates just how nerdy you are? What better way than to tweet from your terminal screen! Here is my quick little guide:
- Somewhere on your computer make a file, i called mine .twitter
- Go into your terminal and make sure the file is executable by running:
chmod +x .twitter - Next up open your file with a text editor, i used vi. You can open it up in terminal with:
vi .twitter - Next up paste this in the file, by making sure you're in insert mode by hitting the "i" key and pasting in":
#! /bin/bashecho -e "Please enter your tweet:"
read tweet
curl -s -u yourusername:yourpassword -d status="$tweet" http://twitter.com/statuses/update.xml > /dev/null - You will need to change your username and password. Hit escape to get out of insert mode. Scroll over to the username and password and change them with the insert mode to insert your own twitter username and password
- Press SHIFT + ZZ to save the file
- Now run the file with:
./.twitterand type in your tweet, check your page to see if it worked!
