My twitter setup

Reading Time: 3 minutes

I have been using Twitter for a while under the handle randomsurfer.
I tend to use web interface sometimes, but regularly I use the command-line/ncurses interface.

There are two main clients that I use regularly. One is ttytter
which is a nice command-line client which offers advanced functionality such as
creating/editing lists and scripting. Refer to the linked page for more scoop. I
would say ttytter is one of the best implementations of Twitter API. It allows
for advanced scripting like:

The above invocation can be used to get the list of everyone you follow and
populate the configuration file to allow auto-completion at ttytter prompt. You
can also run ttytter as a daemon.

Following is how it looks in ttytter for '/again +50 nytimes' which retrieves
last 50 tweets from @nytimes: (click to magnify)

2014-05-03-150028_1920x1060_scrot

However, the one I use most is actually not a client per
se. I use bitlbee‘s twitter plugin. If you
have not heard of bitlbee before, it started as a IM-to-IRC gateway. But, now
it supports more than just IM: bitlbee, skype to name a few. One can write
plugin for any other service, so it is quite pluggable. Now, bitlbee itself is
just a server, you need to connect it to a IRC client.

The IRC client that I use is weechat. I connect
weechat to bitlbee and thus use twitter from that. This was the setup till
sometime. But, then I wanted to keep the backlog even when I close the client.
So, I started using IRC bouncer. zncis the most popular one
and the one I use. So, using bouncer + bitlbee + weechat allows me to connect to
twitter anytime like an IRC channel (literally!) and also retrieve backlog and
what not.

This is how it looks: (click to magnify)
2014-05-03-143208_1920x1060_scrot

If you see above, the tweets have identifiers of the form
[0..9a..f][0..9a..f]. These are used to reply or favorite (ie. like reply
d8
) a tweet and ‘post ….’ to post a tweet. Actually, bitlbee allows for
full IRC mode wherein you don’t need to say ‘post’ to post a tweet but I have
disabled it to disallow any fat-fingered tweets!

In addition, I want to use some of the features of IRC since I am using it
inside an IRC client. So, next, I thought of using highlights. Highlight is
where the tweet is highlighted with the user in that weechat buffer. Weechat
allows to configure per-buffer settings and with buffer_autoset script I use
highlight_regex to get custom highlights.

 "PXC|[[a-z0-9]{2}->[a-z0-9]{2}]|xtradb cluster|wnohang.net|wnohang|Raghu|Galera|Raghavendra" 

is an example of what I use (though not complete). If you see the second one
there, it has an arrow '->' in it. That allows for me to get highlights
for replies. Pretty cool, isn’t it? To add to this, I also have notify_send
(libnotify) hooked into this (through another weechat script I wrote) which
notifies me on selective tweets (no replies here :)). Sometimes I turn off
libnotify notifications (I use a wrapper around notify_send), in those cases,
the window manager urgency hints1(I use xmonad) are used to notify me (in
xmobar).

In addition to above, using twitter inside weechat allows for other IRC client
features like logging, split modes, colors (with rainbow script), easy switching
of buffers (with go script) and so on.

Yes, I use the twitter mobile app and twitter site itself sometimes, especially
I want to look at inline media or the ads (kidding!). Let me know in comments if
you have any similar setups and/or any cool hacks you have!


  1. The notification and visual bell involving xmonad, tmux and rxvt-unicode
    is bit more complex. I had to modify tmux for this, not sure how it works
    upstream, but I have made it bell both the terminal (ie. show a highlight in
    tmux) and also report to xmonad.