Sunday, April 04, 2010

tweeting from the BASH terminal

i feel this an awesome script..tweet from command line terminal in linux..
script is as follows:


username="yourUserName" ;

URL="" ;

if [ $(echo "$1" | wc -c ) -gt 140 ]
echo "Whoo: Its more than 140 characters"
exit 0;

result=$(curl -u $username:$password -d status="$1" $URL) ;

exit 0 ;

save this in some file name "tweet" and make it executable ( chmod +x tweet )
And for simplicty add an alias ..
Now tweet from terminal using the command
tweet "tweeting from the command line"

No comments:

Post a Comment