Tweet from command line

June 3, 2009

I came across this article Twittering from the Command Line. I found that it is interesting, so I decide to share with you.

twitter

Code:

#!/bin/sh

user="your_username"
pass="your_password"
curl="/usr/bin/curl"

$curl --basic --user "$user:$pass" --data-ascii \
        "status=`echo $@ | tr ' ' '+'`" \
        "http://twitter.com/statuses/update.json" > /dev/null 2>&1

exit 0

Usage:

./twitter.sh It is a beautiful day!

I modified the script a bit, so it will not output “junks”, after you update your status. At the end of day, it is a very short shell script and it lets you to update statuses only, but it is fun!

Entry Filed under: main. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

June 2009
M T W T F S S
« May   Dec »
1234567
891011121314
15161718192021
22232425262728
2930  

Most Recent Posts