Posted on by & filed under geek, toc.

Geeks love raw data, so I couldn’t resist a text dump of all #toc tweets that occurred during the conference.

Here’s the quick visualization I threw together (warning, it loads very slowly):

TOC tweet visualization

It skips any images that are broken or any that were listed as having the Twitter default icon. For some reason the raw data included a lot of default icons it shouldn’t have — for example, all of my tweets were listed with the default instead of my profile photo. Those are missing. I recommend starting with the XML instead (posted after I wrote this) and getting the profile icons directly via Twitter.

Source code that generates this from the raw text (not from the XML) follows:

import re, copy, urllib, sys

# Pattern-match the twitter username
p = re.compile('^([^:]+):(.*)$')

data = []
tweet = None

for line in open('toc-tweets.txt'):

    # If we're not currently in a tweet, start a new record
    if not tweet:
        tweet = {}

    # Skip the useless relative date values
    if line.endswith('ago'):

    # This is an end-of-tweet marker, so push it on the stack
    # and reset the temporary datastore
    if line.startswith('*'):
        tweet = None

    # Grab the user's image
    if line.startswith('http://'):
        tweet['img'] = line
    m =
    if m:
        # If we matched the regexps then we have a line containing a valid tweet
        tweet['name'] =
        tweet['message'] ='&', '&')

# Put in chronological order

print '''<html xmlns="">
<meta content="text/html;charset=utf-8" http-equiv="Content-Type"/>
<title>#toc timeline</title>
<script src="" type="text/javascript"></script>
<script type="text/javascript">
      google.load("jquery", "1.3");
<script src="jqueryui/jquery-ui-personalized-1.6rc6.min.js" type="text/javascript"></script>
<style type="text/css">
       .tweet span { display: none; width: 300px; height:200px;  }
       .tweet { display: inline; z-index: -1;}
       .drop { width: 240px; height: 135px; padding: 0.4em; position:absolute;background:white;z-index:99;}
       .drop h3 { margin: 0; padding: 0.4em; text-align: center; }

<link href="jqueryui/theme/ui.all.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
    jQuery(document).ready(function() {
      $('.tweet').click(function() {

images = {}

for t in data:
    if 'default_profile' in t['img']:
    image = t['img'].replace('mini', 'bigger')
    if image not in images:
        sys.stderr.write("Checking %sn" % image)
        i = urllib.urlopen(image).read()
        if 'Error' in i:
        images[image] = 1

    print '''
<span class="tweet">
<span class="ui-widget-content ui-corner-all drop">
<h3 class="ui-widget-header ui-corner-all">%s</h3>
''' % ( t['img'].replace('mini', 'bigger'),
print '''

Tags: TOC, twitter, visualization,

Comments are closed.