curl -u user:pass -d status=?I am Tweeting from the shell? http://twitter.com/statuses/update.xml

Update Twitter From the Linux Command Line

Now all you have to do is replace user by your twitter username , pass by your password and the text inside status to whatever you wish to set your status too . It uses cUrl library to post your messsage

-5
By: techie
2013-04-29 10:12:43

These Might Interest You

  • Update twitter from commandline, without revealing your password and without having to type it interactively. You 'll need to put a line "machine twitter.com login TWITTERUSER password TWITTERPASS" in $HOME/.netrc and better chmod 600 that file.


    7
    curl -n -d status='Hello from cli' https://twitter.com/statuses/update.xml
    svg · 2009-07-05 09:39:37 0
  • An improvement of the original (at: http://www.commandlinefu.com/commands/view/2872/update-twitter-via-curl) in the sense that you see a "from cURL" under your status message instead of just a "from API" ;-) Twitter automatically links it to the cURL home page. Show Sample Output


    14
    curl -u twitter-username -d status="Hello World, Twitter!" -d source="cURL" http://twitter.com/statuses/update.xml
    MyTechieself · 2009-12-08 14:54:33 1
  • 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... Show Sample Output


    2
    curl -u YourUsername:YourPassword -d status="Your status message go here" http://twitter.com/statuses/update.xml
    m33600 · 2009-06-27 21:47:48 6
  • Same as below, but no quotes are necessary when twitting more than one word


    1
    tweet(){ update=$(echo $*); [ ${#update} -lt 141 ] && curl -su user:pass -d source=curl -d status="$update" http://twitter.com/statuses/update.xml ->/dev/null || echo $(( ${#update} - 140 )) too many characters >&2; }
    dfarre · 2010-06-18 09:26:24 0
  • Requires Net::Twitter. Just replace the double quoted strings with the appropriate info.


    2
    perl -MNet::Twitter -e '$nt = Net::Twitter->new(traits => [qw/API::REST/], username => "YOUR USERNAME", password => "YOUR PASSWORD"); $ud = $nt->update("YOUR TWEET");'
    dbbolton · 2010-06-16 19:46:05 1
  • Doesn't require password (asks for it instead) Show Sample Output


    11
    curl -u user -d status="Tweeting from the shell" http://twitter.com/statuses/update.xml
    matthewbauer · 2009-08-05 02:24:01 2

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?

commandlinefu.com 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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: