This Web site was designed to work on Internet Explorer 7 and Firefox. Since you are using an antiquated version of Internet Explorer, the site may not look as expected. You are highly encouraged to update your browser to Internet Explorer 7, or better yet, install Firefox which is a free download at http://getfirefox.com.

Travis

Twitter from the Command Line

Posted on 07/23/2008 by Travis
0 Comments

Many of the staff here at Plexus are on Twitter. While it's hard to explain to other people (micro-blogging?!?!), we've embraced it as a way to share information, see what each other are doing, and, in some cases, decide on lunch plans.

While perusing an especially interesting query on Twitter's search today, I came across a tweet about using Twitter from the command line. Being the computer nerd that I am, this intrigued me. I did some Google-ing and found a few entries from people who had written scripts to make this possible. The best explanation I found was here. He just wrote a simple shell script that used curl to post a status via Twitter's API.

The code is pretty simple.

curl --basic --user "<User>:<Password>" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json"

Just create a file with that line of code, replace the user and password with your account info, save the file as "twitter", put it in your /usr/local/bin directory (Mac), and make it executable. Now you can run the following line in Terminal to post your status:

twitter "Command line status updates FTW!"

Tagged:  Twitter, cli

Comments

No comments at this time.

Post a Comment

Name

Comment

simple_captcha.jpg
Please type the letters from the image above.