Sunday, December 27, 2009

Shell script to post twit.

For posting a simple twit, I had to go on twitter every time, But for lazy person like me, Its too tough. I was looking for a simple tool to post twit. I found a very interesting and simple shell script to post twit from Linux command line.

*Install "curl" if you don't have already.
       #yum install curl
*Copy the colored code and save as twit.sh
*Replace USER with your Twitter A/c's user name and PASSWORD with password.
*make twit.sh executable.
       #chmod +x twit.sh

Your script is ready to post messages.Go to terminal. Use the following command.
$sh twit.sh "Your Message here."


------------------------script start  here--------------------------------------

#!/bin/bash
curl -u USER:PASS -d status="$*" http://twitter.com/statuses/update.xml > /dev/null
echo "Message posted successfully."
----------------------------------------------------------------------------------------- 
Note- This tutorial is for Redhat and Fedora Linux, although you can use this script on any distro if you have "curl" installed on your machine. To install curl on your distro look their installation manual.

0 comments :

Post a Comment