tweet from bash a better alternative!

TSo yesterday I spent a good while looking for options that didn’t require me to memorize a huge long string just to post to twitter, and I thought I had found one until I realized that nope, that only works if your in the same bash session and won’t still be there after a reboot or even just a new terminal window.

So trial and error and I have the solution!

in a terminal window go to /usr/local/bin

[codesyntax lang="bash" lines="no"]


then make a file called twitter

[codesyntax lang="bash" lines="no"]

touch twitter


then open it

[codesyntax lang="bash" lines="no"]

nano twitter


and add this command replacing username and password with YOUR twitter account info

[codesyntax lang="bash" lines="no"]
curl –basic –user “username:password” –data-ascii “status=echo $@|tr ' ' '+'” “”
I can’t believe I didn’t tell you how to actually post! It’s simple, in your terminal window, just enter
[codesyntax lang="bash" lines="no"]
twitter “Your message goes between the double quotes @danstinebaugh”
That’s it!

4 thoughts on “tweet from bash a better alternative!”

  1. running SRWare Iron SRWare Iron on GNU/Linux GNU/Linux
    Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/532.8 (KHTML, like Gecko) Iron/ Chrome/ Safari/532.8

    I still use this often and have to say it’s great! ;)
    Gnome-do publishes the updates in real time, and then I just respond in bash :) Simple!

  2. running Firefox 7.0.1 Firefox 7.0.1 on Windows 7 x64 Edition Windows 7 x64 Edition
    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1

    {“errors”:[{"code":53,"message":"Basic authentication is not supported"}]}

  3. running Google Chrome 15.0.874.121 Google Chrome 15.0.874.121 on Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2

    Yea you’ll notice this was over a year ago, They have moved to “oauth” for login now which is a much better solution.

    Speaking of better solutions check out ttytter ( it’s a GREAT twitter client for a shell. It’s what I have moved on to.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">