Consumer products often have great data that can be used to inform a perspective on trends and market sizing. Two basic scripts I have written for this purpose are outlined below.
I frequently want to know how often a specific @handle is mentioned, or term is used, on Twitter. There are existing tools like Topsy that help answer this question, but I have never particularly liked any of them.
I ended up writing my own simple Ruby script to query the Twitter API for a given term. I then combined this with an R script so that I could graph the number of mentions a day for several terms1.
Occasionally I want to know how many of a certain type of SMB there are in particular US cities. Yelp is one of the best free source of this data2, and using their API it is fairly trivial to set up a basic Ruby script to programatically get a count.