Analyzing Twitter with Excel, Part 4

Be the first to comment | 1I like it!
April 24, 2009, 08:41 AM —  Network World — 

Over the last three weeks I've been trying to figure out how to analyze Twitter messages using Excel 2003, something I thought would be fairly easy but it turns out there are a number of "gotchas." The goal was to track the buzz about a specific product so I wanted to retrieve Tweets that included the product's name and my first thought was to look for the historical data ... which proved to be a headache.

[ To follow this series from the beginning, see Parts 1, 2, and 3 ]

While the Twitter search API can provide a news feed for a given date range you only get the newest 15 Tweets in that period. This isn't going to be of much use if you there was a real buzz about the product.

So, if you want all the Tweets for a given period the only choice is to get the data in HTML format from multiple requests of blocks of search results. Last week I came up with a way to retrieve the required data using two free open source utilities,
cURL to grab and save the search results in a file, and grep to parse the saved data.

I wrapped these utilities in a batch file (which I call tweets.bat) to which I have since added some extra error testing. I also created another batch file, domonth.bat, that calls tweets.bat for each day of a given month. Finally a simple program I wrote is called by tweets.bat and updates a comma separated variable (CSV) file that contains a line for each date with the number of Tweets found.

To perform the analysis in Excel a data source -- the CSV file -- is imported into an existing spreadsheet by refreshing the source, and a graph shows the number of Tweets per day for a given month. I admit it: This is ugly, ugly, ugly, but it works and requires minimal resources.

This system covers the historical data, but usually if you're interested in the public buzz on a specific topic you'll want to monitor that in real-time or thereabouts.

As I pointed out in the first column, to get all of the Tweets in the public timeline you'll need to make arrangements with the folks at Twitter. On the other hand, if the topic you're interested in is generating 15 or less Tweets in a given period (call that X minutes) you could just repeatedly access the RSS feed every X minutes to get a quasi real-time snapshot.

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Close

On Twitter now

twitter

Powered by Twitter
You are logged in | Sign out
Sign in and post to Twitter

What are you thinking?

Cancel Tweet sent

On Twitter now

Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
peer-to-peer

Esther Schindler
If the comments are ugly, the code is ugly

claird
SVG a graphics format for 21st century

pasmith
Take Chrome OS for a test spin

Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?

sjvn
64-bits of protection?

jfruh
Android fragments vs. the iPhone monolith

mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive

 

Where Google Chrome security fails: the password
I heard mention that the Chrome OS will have some sort of encryption available a la bitlocker. If it's possible to encrypt personal data using another password or key, then it may have potential for very secure data.... And Ubuntu has an 'encrypt home directory' option, perhaps google should follow suit.
- Dann

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace