Twitter update from terminal (pok3's snipts ?)

curl -u YourUsername:YourPassword -d status="Your status message go here"
Found it on snipt, pok3, is it yours? I put my user = m33600, the password and the status was my robot message: Settima robot message: ALARM ZONE 3 (sent via command line). Now bots may have their identity on twitter...
Sample Output
<?xml version="1.0" encoding="UTF-8"?>
  <created_at>Sat Jun 27 21:33:19 +0000 2009</created_at>
  <text>Settima robot message: ALARM ZONE 03 (sent via command line)</text>
    <created_at>Tue Nov 06 00:18:20 +0000 2007</created_at>

By: m33600
2009-06-27 21:47:48

6 Alternatives + Submit Alt

What Others Think

How would I avoid revealing my password to ps?
kaedenn · 619 weeks and 5 days ago
Nifty. I'll use this for my Nagios monitor. Thanks.
Scott · 619 weeks and 5 days ago
@kaedenn: Take a look at the --netrc option in man curl. See also man netrc. (not tested)
dennisw · 619 weeks and 5 days ago
I wrapped this into a shell script that asks for your username, then password, then message and then sends it to twitter. I would like some help, if anyone knows, in verifying whether the message actually gets sent or not and then returning that info to the command line. Anyone interested in the command, let me know and I will post it here.
dilbert4life · 619 weeks and 4 days ago
If you ommit the password, it will be asked by the curl command interactevely. In this way you can hide the passwd. curl -u user -d status="Tweeting from the shell"
mdelatorre · 619 weeks ago
I d like to improve it to receive the status messaage form stdin, as a variable, so other programs may send info to twitter. As an example " Temperature in my room is %T now"
m33600 · 618 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: