Tag Archives: Twitter

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.

Suggestions to improve conference scheduling

So, I finally was able to complete my PDC sessions scheduling. It was a bit more “involved” then I expected, and I have a few suggestions for, in this case, Microsoft as they prepare for future conferences:

  • Enable Outlook (ICS-based) scheduling sooner
  • Include the online session home page as a link in the ICS file
  • Default to “no alert” in ICS files (e.g. avoid creating noise from multiple sessions of interest all vying for my attention on my smart phone)
  • Add a map link to help guide attendees to where sessions are being held (i.e. nowadays location-aware service is expected, IMHO; so, allow users to opt-in where correlating to present location (device GPS coordinates) is concerned)
  • Promote session hashtags (e.g. help guide the use of Twitter et al by going beyond just #PDC09)
  • When you post a location and date/time, and you change it, indicate the change more prominently (e.g. maintain version history)

Next year, I’d love to say something like, “I’m a PC. PDC10 scheduling…was my idea.” :-)

Getting Twitter

Twitter

Yeah, I know that Twitter lately is all about Oprah, CNN and Ashton Kutcher, but it’s also about brief remarks, gripes and triumphs related to products and/or services that you send into the world wide market. (And if you were waiting for The Tipping Point, it’s already occurred for Twitter, IMHO.)

BTW, before I go any further, I’m @craigsmusings on Twitter. (Thanks, Dan.)

If a tree falls in a forest, it always makes a noise–regardless of your presence there. There are social conversations that occur online (e.g. Facebook, blogs, wikis, Twitter, newsgroups, IIRC, etc.), and they will continue to occur regardless of your presence there, too. However, that’s an especially risky position to take these days–see the conversation but not engage.

Consider the following conversation on Twitter:

http://twitter.com/johnsmith

Very disappointed in _YOUR_PRODUCT_HERE_, does not appear to have very much to it at all….if anything!
12:10 AM Apr 23rd from TweetDeck

http://twitter.com/janedoe

@johnsmith Did you see a live presentation or play with it,
4:45 AM Apr 23rd from TwitterBerry

http://twitter.com/johnsmith

@janedoe Had a play with it, will blog later this week, does not seem to give us anything to use as an accelerator
4:52 AM Apr 23rd from TweetDeck in reply to janedoe

http://twitter.com/janedoe

@johnsmith Ouch! That’s the point in theory.
4:58 AM Apr 23rd from TwitterBerry

So, what will John Smith blog exactly? He’s indicated that his post is forthcoming but also that there may be time to engage him–understand his concern and possibly influence him after listening by demonstrating value.

Jane appears to be an interested party, too. Is Jane a known advocate, possibly trying to reach out on your behalf? Is Jane known to be skeptical?

How can you “see” this conversation?

I use TweetDeck, an Adobe AIR-based Twitter client, for my tweeting, etc. It works equally well on both MacOS and Windows. (There are many other clients out there, too!)

TweetDeck

TweetDeck allows me to do a number of useful things.

  • For example, the leftmost column/pane is a group. (You can read that tiny font, right? ;-) ) In my case, I filtered All Friends (i.e. those I follow in Twitter) into just the subset that tweets about content management. (You can see that there is a horizontal scroll bar on the bottom, and the default “All Friends” column/pane is off to the far right (where I moved it to reduce seen UI changes).)
  • The “Replies” lumn/pane is just what it implies–tweets in reply to me from others.
  • The “Direct Messages” column/pane contains DM’s from me and DM’s to me.
  • The two rightmost columns/panes in view above are searches. Since these are Twitter-based searches–one for tweets containing “CMIS” and another for tweets containing both “EMC” and “Documentum”–I receive traffic updates that apply in near realtime (unlike, e.g., a Google search that requires one to hit Refresh to see new results).

Anyway, I can visit John Smith’s Twitter profile to learn that he has a 70:30 ratio (i.e. he’s following 70 twitters and 30 twitters are following him). Clearly, Mr. Smith is not a “rock star” by Twitter standards. (Certainly, I am not either!)

However, consider the junior high campfire song’s sentiment: “It only takes a spark, to get a fire going…” This goes back to my point above: there may be time to engage him–understand his concern and possibly influence him after listening by demonstrating value (and create a positive fire–however big or small–about your product or service).

The truth is that, although I’ve been blogging for awhile now, I’m relatively new to Twitter. Fortunately for me, I have great resources in my “2.0 type” EMC colleagues and elsewhere online. For example, I recommend that you check out Gina Minks’ Twitter Cheat Sheet. (I understand from Gina that a v2.0 release is due out in time for EMC World, too.)

I recall during last year’s Microsoft Strategic Architect Forum (SAF) that a good industry colleague of mine suggested a “I don’t get Twitter” topic for the open space segment of that afternoon. I egged him on to make the suggestion; so, of course I attended…and I think that everyone learned a fair bit in the process.

Since then I’ve only recently begun to seriously tweet. Already that engagement has paid dividends, and due to the fact that most of my cross-domain architect colleagues don’t yet tweet, I thought I’d humbly offer this post to get them to “dive into” Twitter, too, in a way that’s both meaningful to them and meaningful to their communities. (You know who you are. :-) )

For those who weren’t at or don’t know about SAF, Microsoft worked with Mindjet to mind map the open space sessions. Here are the notes from the “I don’t get Twitter” session in mind map form–just click the following image for the .mmap (MindManager 8 format) file:

SAF08 topic - 'I don't get Twitter' (notes as mind map)

So, what do you think of Twitter? If you find it useful, how do you receive value from it?

Update 4/30/2009: Gina Minks just published a new cheat sheet for tweeting from your phone.