Adventures with Twitter in Groovy

Have you ever wanted to get a better sense of an event’s commentary on Twitter? For example, a subset of your following may be attending an event in your periphery but making interesting enough comments to warrant a closer look.

Well, I’ve had these thoughts on an increasing basis lately so I thought I’d dive into the Twitter stream a bit to see what I could learn.

Fortunately, I was aware of a gist to query Twitter by @pmonks, and this Groovy script became the foundation for my exploration.

Since I don’t normally program in Groovy, I had to setup Groovy on my MacBook Pro. (To be clear, I went for “get this to work” rather than “accomplish your configuration with all best practices incorporated.” I’m sure there may be better techniques where Groovy setup on MacOS is concerned, and I thank you in advance for any comment-based pointers.)

  1. Visit the Groovy website and understand basic Groovy installation instructions.
  2. Downloaded the binary release (Zip) of Groovy 1.8.6 (i.e. latest available version of the stable branch at the time of this post).
  3. Extracted Zip contents and moved (via Terminal) them under my up-to-date Java distribution:
    prompt$ sudo mv ~/downloads/groovy-1.8.6 /usr/share/java

    (I’ve seen apparent best practice guidance to create a symlink that allows you to access Groovy without referencing the version number, but I’ve skipped that here.)

  4. Edit your .profile file to point your environment to your new Groovy installation. (If you don’t have a .profile file, read and follow this.)
    prompt$ open /Applications/TextEdit.app .profile

    Add (or confirm) the following lines in your .profile file:

    JAVA_HOME=/Library/Java/Home; export JAVA_HOME
    GROOVY_HOME=/usr/share/java/groovy-1.8.6; export GROOVY_HOME
    PATH=$GROOVY_HOME/bin:$PATH; export PATH

    Save your .profile file, exit TextEdit, close all open Terminal windows, exit Terminal and open a new Terminal window to enable .profile changes to take effect.

  5. Confirm that Groovy is ready to act on your script:
    prompt$ groovy -v

    My confirmation looked as follows:
    Groovy Version: 1.8.6 JVM: 1.6.0_31 Vendor: Apple Inc. OS: Mac OS X

For this particular script, queryTwitter.groovy, you need to provide a peer twitter4j.properties file that will provide to Twitter your username and password. Once that’s ready,

prompt$ groovy queryTwitter.groovy %23interesting_event

The results are ready to be nested within a table element, if you want to produce HTML for display as-is. However, you could also modify the script to render JSON output and pursue alternative visualizations (e.g. rate of tweets over time, geolocation of individuals in the tweetstream, word clouds for the event, influencer status, etc.)–something for D3.js.

D3 (Data-Driven Documents)

Examples of D3-based visualizations

“D3.js is a small, free JavaScript library for manipulating documents based on data.” -http://mbostock.github.com/d3/

Since I’ve been trying to spread the word with colleagues about this powerful, expressive visualization technology, I thought it might be worth sharing similarly here.

The following tutorials have been helpful in ramping folks up on D3:

D3′s creator, Mike Bostock, has published a white paper on D3 (Stanford Visualization Group) and presented D3 during the most recent W3Conf (browser-based slides).

A couple of spotlights on D3 include one by Flowing Data and another by SVG Magazine.

Flowing Data also posted an application of D3, “How Americans Spend Their Day” (background context).

If this whets your appetite, visit the D3 wiki for a whole lot more goodness (documentation, additional tutorials, example visualizations, etc.).

Modularity without modules…what’s the point?

If you follow me on Twitter, you might have an idea that my son is currently without one of his rides (i.e. a Razor Cruiser kick scooter). My son is big and tall for his age, and this scooter is perfect for him.

Like most boys his age, though, he doesn’t understand “cruiser” in the face of a neighborhood of boys who all like to jump all manner of wheeled vehicle. :-) As a result of this lack of appreciation (er, love of both scooter and jumping), what looked like

Unridden Razor Cruiser kick scooter

now looks like

Used Razor Cruiser kick scooter front assembly

Failed wood/fiberglass Razor Cruiser kick scooter deck

Failed wood/fiberglass Razor Cruiser kick scooter deck (close-up)

Used Razor Cruiser kick scooter back assembly

Do you see the opportunity?

Razor makes a quality product–one the is easy to use and maintain. Ease of maintenance is largely facilitated by modularity of design.

So when my son came to me with the disappointment of pushing his ride too hard, my first thought was to simply disassemble the scooter to isolate the failed part (deck). Easily accomplished.

Except that apparently Razor and its authorized parts retailers doesn’t stock replacement decks for the Cruiser kick scooter.

So…Razor built a modular kick scooter but doesn’t stock a critical module (deck).

What’s the point of modularity, if there are no modules (i.e. ability to swap module instances that fulfill necessary interfaces)?

My son’s predicament is clearly of his own making, but herein is opportunity for Razor. Beyond already clearly stating what their product is designed to perform, Razor can anticipate that boys will be boys and provide timely relief in the form of complete replacement parts, including readily available decks.

Within earshot of my son are more than a dozen boys of similar age, and they’re always outside planning their next jump. Many already own their own Razor, too. What if he could turn around an accident with word that Razor saved the day? Talk about brand advocacy and social media!

What’s your Razor-like story? What’s your Razor-like opportunity?

Adobe Connect bookmarklet

Here is a technique you can apply to your browser to make your Adobe Connect room joining workflow more streamlined.

If you work at Adobe, you use Connect on a regular basis. After a while, and in the face of shortened URLs (and everything else), you start to just think in terms of frequented room names.

If this sounds like you, you can simply your Connect room joining experience as follows:

javascript:q=window.getSelection();
if(q==""){q=prompt('Please%20enter%20the%20name%20of%20
the%20Adobe%20Connect%20room%20you%20wish%20to%20join:')};
if(q)location.href='http://my.adobeconnect.com/'+escape(q);

This code is simply the logic inside a bookmarklet that you can drag and drop into most modern browsers. That is, you can drag the following link into the links bar of your browser: Connect

Then you can click on the bookmark link to receive a dialog as follows:
Adobe Connect bookmarklet dialog

Please note that you may need to replace “http://my.adobeconnect.com/” with your Adobe Connect host URL.

(HT @chrisvls)

P.S. While we’re talking about Adobe Connect productivity, I recommend that you visit the Adobe Connect User Community downloads page for additional tools.

The Experience Architecture

In my #AdobeMAX session today, I presented a set of experience architecture principles with my colleague Marcel Boucher as follows:

I’ve gone into greater detail about these principles in a technical white paper that is available from the Adobe Enterprise Developer Center as a PDF download.

During our session, Marcel presented two demonstrations:

  1. The first demonstration featured an overall vision for customer experience in the retail banking domain. If you weren’t able to catch this demo live, you can see it presented here during the FinovateSpring 2011 event.
  2. Marcel’s second demonstration provided more of the how behind the vision in terms of Adobe’s integration across its Web Experience Management (WEM) solution, SiteCatalyst and Test&Target. A video similar to Marcel’s demonstration of this integration is available here.

MAX is always a great event, and the enterprise team at Adobe is looking forward to sharing more with you about Digital Marketing at our upcoming summit in March 2012.