Saturday, June 11, 2011

How To Make Twitter's Web Client Suck Less

I use the web version of Twitter exclusively, even on the iPad. The reason is simple: it seems to be the only client which acknowledges its non-universality. If I use custom Twitter clients on any device, each such client assumes A) that I have no other clients running on the same device and B) that I use no other devices. Consequently, every time I use custom Twitter clients, I'm constantly getting notified as to the number of "new" and "unread" messages which are neither new nor unread.

No, goddammit, I don't. I really don't.

What this comes down to, basically, is a furious, hostile intolerance for clutter and distraction. Although I agree with Master Yoda that hate leads to suffering, distraction also leads to lost productivity, lost opportunities, regret, and a generally useless existence - and our world today is filled to bursting with distractions. Case in point: the Twitter web client. Although it sucks less than every other Twitter client when it comes to acknowledging and accommodating the patently obvious reality that people access Twitter on multiple devices, it still pelts you with useless distractions aplenty - specifically, inane lists of trending topics, suggestions that I follow Kim Kardashian, and similar pointless horseshit.

Fortunately, however, this is very easy to fix. You can have a much more serene experience reading Twitter with negligible effort. In fact, this is how the Twitter web client looks to me.

The secret sauce is dotjs, an absolutely fantastic project by Chris Wanstrath, inspired by a remark by his GitHub colleague Ryan Tomayko, which is ironic, because I've also used dotjs to fix GitHub.

After you install dotjs, all you need is a ~/.js/twitter.com.js file which looks like this:

The technique is simple: we insert inline CSS <script> tags which set display: none; for the relevant CSS selectors. We do this, rather than a simpler $("selector").remove(), because dotjs runs your ~/.js/whichever-domain.js file when the page loads, but Twitter first loads a skeletal page and then populates it via Ajax. This updated version of the file not only removes all the specific stuff mentioned above, it even wipes out the entire dashboard div, giving an even cleaner version: