How to Twitter from Terminal on the Mac
UPDATE
This post is woefully out of date. Happily, Floodgap Software has released an OAuth-compatible version of a Twitter terminal/command line client, TTYtter, which is the best thing since sliced bread. I’m keeping the post below for historical reasons, but it is broken for sure.
END UPDATE
The Mac’s Terminal is the UNIX command line. It’s hard core, the stuff that Apple actually tries to keep away from the casual user. It’s the direct line to the heart of the machine, and it’s where cool scripting action can occur. Here’s how to set it up so that with a couple of key strokes, you can send a Twitter absurdly fast. You’ll need to have curl compiled and installed on your Mac as a prerequisite.
1. Copy this script to a text file named twit.sh:
#!/bin/bash curl -u twitterusername:twitterpassword -d status="$1" http://twitter.com/statuses/update.xml
Obviously, substitute twitterusername and twitterpassword for your credentials.
2. Open Terminal and sudo chmod this file to 777.
3. Copy it to your home directory or put the location in your path.
4. Next, open up your bashrc file, which on the Mac is located at /etc/bashrc – note that you’ll have to either chmod it (bad) or sudo pico / sudo nano it to save your changes.
5. Set up an alias for the twitter script:
alias tw="/Users/yourmacusername/twit.sh"
6. Close and quit Terminal, then relaunch it. If you plan on using this a lot, you’ll probably want to put Terminal in your Dock, if it’s not there already.
7. Pop open terminal and type:
tw “Testing twitter from the command line!”
8. Check your twitter page to ensure your Tweet posted.
-
http://twitter.com/danieljohnsonjr Daniel Johnson, Jr.
-
http://twitter.com/danieljohnsonjr Daniel Johnson, Jr.
-
http://chrisbrogan.com Chris Brogan…
-
http://chrisbrogan.com Chris Brogan…
-
http://mcandre.wordpress.com Andrew Pennebaker
-
http://mcandre.wordpress.com Andrew Pennebaker
-
http://carlos-presencia.blogspot.com/ carlos
-
http://carlos-presencia.blogspot.com/ carlos
-
http://carlos-presencia.blogspot.com/ carlos
-
http://carlos-presencia.blogspot.com/ carlos
-
http://murphymac.com Murphy Mac
-
http://murphymac.com Murphy Mac
-
http://www.ChristopherSPenn.com Christopher S. Penn
-
http://www.ChristopherSPenn.com Christopher S. Penn
-
http://celo.wordpress.com crimeboy
-
http://celo.wordpress.com crimeboy
-
Jesse
-
Jesse
-
Bonnie
-
Bonnie
-
Bonnie
-
Bonnie
-
http://twitter.com/murkee Murk
-
http://www.ChristopherSPenn.com Christopher S. Penn







