Excel, Twitter, FreeBASIC and a book

14.05.2009
I've written about Twitter on and off over the last few weeks and it seems that interest and innovation in social media in general and Twitter in particular continues unabated.

To keep track of all of the Twitter applications and services that are appearing, about a month ago I started to compile a directory of Twitter stuff. This was going quite well (I was up to 224 outline entries) but then a few days ago reader Chris Miller (St. Louis, Mo.) wrote to tell me that he had noticed my "Twitter binge" and suggested that my obsession might be aided and abetted by his Twitter directory at .

He's right. This Web site is a great compendium of all things twitterific and well worth exploring to see what tools and services might be valuable to you. I award EverythingTwitter.com a 5 out of 5 rating.

In the last that analyzed Twitter with Excel I offered readers a copy of the batch files and utility programs I had assembled to grab and analyze Twitter data. What I eventually sent out wasn't quite what I had planned. The system of batch files just wasn't up to the job, so in addition to cURL, I resorted to a suite of ugly little programs I wrote using .

FreeBASIC is a free, open source BASIC compiler for Windows that is mostly QuickBasic-compatible and also provides features such as threading, operator overloading, function overloading and namespaces. FreeBASIC comes with an integrated development environment and, as a way to build quick and dirty tools, it's outstanding.

The only drawbacks are that it is Windows-only, sometimes produces diagnostic messages on programming errors that make little sense, and some of the documentation is incomplete. Bottom line: An excellent tool despite its minor shortcomings. I'll give FreeBASIC a rating of 4.5 out of 5 — definitely something to keep in your toolbox.

In my Excel/Twitter solution a main program takes the command-line arguments (these are a search term and start and stop dates) and calls a helper program for each date in the range specified.

This helper program, in turn, loops for as many as 500 "pages" of search results by executing a PIPE command using cURL. The PIPE lets cURL's output (the results of a Twitter search) be read by the helper program and parsed to count the number of Tweets returned (by searching for the string 'class="avatar"', only occurs in the user data associated with a Tweet … I did say it was ugly).

The helper program (which I created to ensure that the PIPE input to the program was closed before performing the next PIPE command) calls another utility that builds a CSV file (that is named after the search term) and, voila! You wind up with a data file that you can haul into Excel and slice and dice to your heart's content.

All of you who asked for this package of programs, this cornucopia of code, this salmagundi of software, should have received an e-mail by now – if you didn't hear from me or have yet to request the files, then please resend your request to "gearhead@gibbs.com" with the subject "TA" otherwise your request may not be noticed.

To close this week I want to recommend a book that anyone designing Web applications will find really useful: Effective Prototyping with Excel by Berger et al (Morgan Kaufmann, 2009). This well-designed book details techniques for using Excel as a user interaction prototyping system. It is thorough, insightful and capitalizes on a tool every IT professional will have anyway. Terrific stuff and worth a 5 out of 5.