Analyzing Twitter with Excel, Part 1

By Mark Gibbs, Network World |  Software, Excel, Twitter 1 comment

Excel is one of those programs with so much depth that there are whole areas many of us will never come to grips with. One such area is Excel's support for XML through the program's XML maps feature. XML maps are a powerful tool if you can figure out how they work so this week we're going to do exactly that. Or at least, something like that.

Let's create a problem: You've been asked by the CEO (which means you've been commanded) to find out whether people are talking about the company's new product on Twitter. The CEO wants to see daily "visibility" reports because he's hoping he'll get a sense of how effective the PR campaigns are.

So, first of all let's check out the Twitter API documentation. Twitter offers a whole galaxy of API functionality but the interface that allows us to grab the public timeline only samples the last 20 Tweets (Twitter messages), which is hardly a representative sample. In fact, to get direct access to the complete public timeline we'd have to make special arrangements with Twitter management, so let's look for a different strategy.

Twitter actually provides an API that can simplify our problem: The Twitter Search API lets you create a search and generate an RSS feed for a specific search.

So, let's say that we're the WowWee Group and what we're tracking on Twitter is mentions of the Rovio, the company's Wi-Fi controlled robot camera.
<digression>I must briefly applaud WowWee for the Rovio. This is an amazing toy, er, robotics experimentation platform with a full and rich API and a ton of slick technology. You might 'need' one in your office. The Rovio gets a 5 out of 5!</digression>

If we go to the Twitter Search service we can try a search for "rovio" and, using the advanced search, ask for the date range from Feb. 1 to March 24 (the logic for this is that I'm writing this on March 24).

The result of this search will be, by default, a list of the last 15 items. If you change this in the advanced search dialog to, say, the maximum of 50 (which is odd as the documentation says that the maximum is actually 100) the new default will be defined by a cookie setting and this leads to a problem.

While the resultant RSS feed will list the correct number of items when we access it from our browser (the cookie will be returned defining the number of items), we need a real search URL that can run from any process without needing the cookie data. This requires we modify the search URL from: http://search.twitter.com/search.atom?q=+rovio+since%3A2009-02-01+until%3A2009-03-24  (to:) http://search.twitter.com/search.atom?q=rovio&since%3A2009-02-01&until%3A2009-03-24&rpp=50&page=1

I replaced all of the "+" signs separating the arguments (which do not conform to URL encoding standards) with ampersands ("&" -- the more usual argument separator for HTTP requests), added the results per page (rpp), and added a page argument of 1.

Before you ask, no, I have no idea why I couldn't have appended "+rpp=50" in the Twitter search URL, but there we have it -- the wonders of Twitter's documentation (or rather lack of it) and the search interface.

Anyway, now we have a way of requesting an Atom formatted RSS feed and we're ready to access and analyze the data using Excel ... which we'll start on next week.

1 comment

    Anonymous 2 years ago
    i gust want to say some thing "great job"Update your Twitter randomly according to your intrest Or, from Rss Feed Or, from your own tweet message list Or, Any combination of the above three http://feedmytwitter.com

      Add a comment

      Post a comment using one of these accounts
      Or join now
      At least 6 characters

      Note: Comment will appear soon after you have activated your account.
      Obscene/spam comments will be removed and accounts suspended.
      The information you submit is subject to our Privacy Policy and Terms of Service.

      ITworld LIVE

      SoftwareWhite Papers & Webcasts

      White Paper

      Best Practices Guide: Microsoft Exchange 2010 on VMware

      This guide provides best practice guidelines for deploying Exchange Server 2010 on vSphere.

      White Paper

      Free Trial: vRanger, the Powerful VMware Recovery Solution

      When disaster strikes, don't waste hours and dollars recovering critical data. vRanger delivers blazing-fast speed and granular recovery for your VMware applications and data. Get your free trial today.

      White Paper

      Executive Guide to Business and Software Requirements

      This paper is designed as an executive briefing on the issues surrounding business and software requirements. It features a wealth of statistics and tactics to help you get requirements right, and includes a tear-out single page summary.

      White Paper

      How to Launch a Successful IT Automation Initiative

      Corporations across all industries are under increasing pressure to cut costs and work more efficiently. In the race to meet both of these requirements, many organizations turn to technology, often purchasing and installing disparate pieces of software in hopes of achieving efficiencies not afforded by manual systems.

      White Paper

      Why Corporations Need to Automate IT Systems Management

      With corporate budgets being slashed and leaders expecting more out of their employees, companies are forced to do more with less, yet are still expected to provide the highest quality experience to customers. This is pushing them to make better use of their IT assets without breaking the budget. Companies are under more pressure than ever, thanks to data management regulations; increasingly complex security threats; and growing demand from management and end users for 24/7 uptime and high performance. These hurdles require a strategic investment in technologies that boost efficiency, save money and position IT as an integral part of the entire firm's operations. IT systems management is helping corporations fill these gaps.

      See more White Papers | Webcasts

      Ask a question

      Ask a Question