So Dr. Twoot remained unusable, stuck with an obsolete Basic Authentication infrastructure, as I tried a variety of other clients. Echofon, HelTweetica, Hibari, Itsy, Kiwi, YoruFukurou, and maybe some others I can’t remember all got a tryout. They were all close to what I wanted, but because I didn’t write them, they didn’t fit me as well as Dr. Twoot had.

During the time I spent trying to do the OAuth stuff in JavaScript, I had run across the Python oauth2 library and used it as check against my JS code. I found it really easy to write with and wished I could do all of Dr. Twoot in Python. Eventually, I realized that I could use Python as an intermediary between Dr. Twoot and Twitter by writing a CGI script that

takes requests from Dr. Twoot,

sends them to Twitter wrapped in the proper authentication,

accepts the response from Twitter, and

passes the results back to Dr. Twoot.

The CGI script sits on my local machine, which is already running the Apache webserver. Conceptually, it looks like this:

With this structure, most of Dr. Twoot’s code remain untouched. Only the calls out to the Twitter API had to be redirected to the CGI script. The CGI script itself is pretty simple, built off an example given on Twitter’s page explaining the single access token method for OAuth.

To get the authentication credentials that go in Lines 10-13, I had to register myself and Dr. Twoot with Twitter, but that was pretty easy. The single access token method was designed for single-user applications like Dr. Twoot, and it avoids a lot of the usual back and forth dance that comes with OAuth. If you want to adapt Dr. Twoot for your own use, you’ll have to register to get your own credentials. It’s not as scary as it sounds.

Although it’s more complicated to set up, Dr. Twoot is as easy to use as it always was. It’s a site-specific browser (SSD) built with Fluid, and it launches just like any other application. The new CGI script is run by Apache automatically in the background; I don’t have to think about it at all.

One of the things I missed during the months using other clients (and—horrors!—the Twitter web site) was seeing @DrSamuelJohnson’s tweets appear in IM Fell, a webfont with an 18th century look.