My Twitter from Command Line Bash Script

Meta: November 12th 2008 // Ideas // 49 views

So you want to be able to nerd it up and show you’re mates just how nerdy you are? What better way than to tweet from your terminal screen! Here is my quick little guide:

  1. Somewhere on your computer make a file, i called mine .twitter
  2. Go into your terminal and make sure the file is executable by running:

    chmod +x .twitter

  3. Next up open your file with a text editor, i used vi. You can open it up in terminal with:
      
    vi .twitter

  4. Next up paste this in the file, by making sure you’re in insert mode by hitting the “i” key and pasting in”:

    #! /bin/bash       

    echo -e "Please enter your tweet:"
    read tweet
    curl -s -u yourusername:yourpassword -d status="$tweet" http://twitter.com/statuses/update.xml > /dev/null

  5. You will need to change your username and password. Hit escape to get out of insert mode. Scroll over to the username and password and change them with the insert mode to insert your own twitter username and password
  6. Press SHIFT + ZZ to save the file
  7. Now run the file with:

    ./.twitter

    and type in your tweet, check your page to see if it worked!

Tags: , ,

WeDecal.com

Postscript: Leave A Comment // Subscribe (RSS Feed)

Want To Be Heard? Comment Here!

// I Love Comments, Especially Nice Ones

Who Are You?

Your Email Address

Your Website

:D :) :o :eek: :( :lol: :wink: :arrow: :idea: :?: :!: :evil: :p

You can follow any responses to this entry via its RSS comments feed. You may also leave a trackback by clicking this link.