Excel, Twitter, FreeBASIC and a book

14.05.2009

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.