SEARCH

How-To Geek

How to Use the Linux Terminal to Update Twitter

032

Twitter has become an addicting, fun distraction for many of us. But since it’s mostly a text only media, why not tweet while you’re working in the Linux terminal? Score some geek points, and tweet the Linux geek’s way.

 

Welcome to Twidge - GitHub - Chromium_004

Twidge is a simple Twitter client for the Linux command line. There are other command line Twitter clients, but Twidge is simple to use and easy to install, where many others have not been updated since Twitter changed authorization, and therefore do not work. The Twidge project can be found here, at github.

Selection_006

The github wiki page has links to source, Debian and Arch Linux Packages. Choose whichever suits you, suited for whatever distro of Linux you happen to be running. We’ll be downloading the Debian package and installing it into Ubuntu. Here’s two ways to install Twidge.

 

Option 1: Add Repositories and Install Via Command Line

Selection_009

If you prefer, you can edit your repositories by opening up a Terminal and running:

$ sudo gedit /etc/apt/sources.list

The current repository you’ll have to add in your sources.list is for “squeeze” the current stable release. Copy it from here, if you dislike typing.

deb http://ftp.de.debian.org/debian squeeze main

Save this repository to your sources.list to be able to download Twidge. In order to install from the command line, run:

$ sudo apt-get update

$ sudo apt-get install twidge

Twidge will be ready to run. If you prefer to install in a more Windows-user friendly method by downloading the Debian package, read the next step.

 

Option 2: Download and Install the Debian Package

Selection_007

Assuming you’re using Ubuntu, you should find the links to the Debian packages on the Twidge wiki front page. As of this posting, the current version is “squeeze,” so navigate to that via the link below.

Selection_008

Many different architectures are available. Most readers are probably i386 or amd64, although there’s a good chance most of you Linux geeks already know that. Download the appropriate architecture from any mirror that suits you.

Package Installer - twidge_011

Simply double-click the package to install.

gdebi-gtk_012

Easy enough. Keep in mind that installing this way means you cannot pull updates from the repository, so if there’s a major update to Twidge, you’ll have to download and reinstall yourself.

Setting Up Twidge

013

Open up a terminal. We’ll need to run the setup for Twidge, which is a simple, if not obvious command.

$ twidge setup

020

Twidge runs an authorization, generating a secure link to a page where Twitter authorizes the application. Click it to open it in your browser.

Twitter - Authorize an application - Chromium_018

Another easy step. Input your username and password, and click authorize.

Twitter - Authorize an application - Chromium_019

You’ll get a PIN to copy into your terminal where it requests it.

017

Simply type or paste the key from your browser into your terminal window shown above.

021

And you’ve set up Twidge. In order to learn the ropes, don’t be afraid to read the man page:

$ man twidge

Sending That First Tweet

022

You can always update your Twitter with your newly authenticated client by using the following command:

$ twidge update

And then typing your 140 character update, as shown above.

025

Likewise, you can check your @replies with the command:

$ twidge lsreplies

028

And this is the command to see the most recent updates from your timeline:

$ twidge lsrecent

029

However, this is LINUX! Why waste time typing long commands when you can create aliases in your .bashrc file and save yourself the hassle?

$ sudo gedit ~/.bashrc

Then add:

alias tweet=”twidge update”

alias replies=”twidge lsreplies”

alias recent=”twidge lsrecent”

Then save and close your gedit window. The aliases “tweet,” “replies,” and “recent” will do in place of the normal versions in the man page for Twidge.

sshot-176

Your tweets appear, easily sent via the command line. Enjoy using your Terminal to tell everybody about your breakfast!

Eric Z Goodnight is an Illustrator and Graphics Geek who hopes to make Photoshop more accessible to How-To Geek readers. When he’s not headbanging to heavy metal or geeking out over manga, he’s often off screen printing T-Shirts.

  • Published 05/4/11

Comments (12)

  1. withanamelikedave

    setting status based on system events…cool!

  2. Marc W.

    I’ve written a Windows based command line client to update Twitter (only). Hope you don’t mind me linking it here:
    http://www.weintraub.net/tweetcmdr/

  3. Travis

    I’d love to know more about your MOTD and aliases!

  4. Teotoo

    Just like to point out that you don’t need to add the sources in Ubuntu. You can go straight to “sudo apt-get install twidge”, and carry on… (:

  5. Jack Mottram

    Depending on your setup, ‘cabal install twidge’ might be a better bet (I had problems with dependencies).

  6. John

    Anyone else getting this error after doing ‘twidge setup’ command?

    twidge: user error (Error from oauthRequest: “HTTP/1.1 401 Unauthorized”)

  7. Eric Z Goodnight

    I’ve not had that problem. Twidge was the program that passed oauthRequest for me in a sea of apps that didn’t work. Can anyone else replicate this?

  8. mrhhug

    i authorised twidge with lynx – im running X right now, but just out of general principle.

  9. evs

    You are a geek when you can update your twitter with twitter api via telnet :)

  10. Moritz2112

    Hats off to you evs, never would have thought to try that. Now, how about a tip on piping the output of fortune into twidge, xargs, perhaps? I am too busy/lazy to rtfm right now…

  11. Moritz2112

    Nope, not even as hard as all that…

    fortune | twidge update

  12. Moritz2112

    I guess I DID have time to RTFM…

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!