Twitter from a Unix Command Line

73
vote

Microblogging seems to be all the rage nowadays. We recently wrote about a popular microblogging platform called twitter.

Wouldn't it be nice to send a twitter post from your Linux command line. It seems to be the perfect application for command line folks.

Here are some instructions on how to create your own twitter script.

Step 1)
Make sure you have curl installed. If not download it and install.

Step 2)
Create a file

Example:

vi /home/bin/twitter

#Add the following lines

curl --basic --user "username:passwd" --data-ascii "status=`echo $@|tr ' ' '+'`" "http://twitter.com/statuses/update.json" -o /dev/null
echo Message Sent Successfully!

#Don't forget to change the username and passwd to match your twitter account details

Step 3)
Make the twitter script executable

Example:

chmod 755 /home/bin/twitter

Step 4)

Run your script:

/home/bin/twitter Here is my first twitter message

Happy microblogging!
_____________________

Vassilios
Co-Founder
OuterVillage.com
http://outervillage.com

If you enjoyed this posting please subscribe to our RSS feed or submit it to your favorite social networks.

None
A comma-separated list of terms describing this content. Example: funny, bungee jumping, "Company, Inc.".

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Youtube and google video links are automatically converted into embedded videos.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
15 + 0 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
website statistics