This Merge XX festival is the first time I've found Twitter useful for anything other than keeping up with friends. The conversation around #xxmerge has been fun to follow and also useful for gathering information (like what band is going to play next, or who are we missing as we're driving down 15-501 towards the Cat's Cradle). I was curious how many of the #xxmerge tweeting particpants were from outside of the Triangle, so I wrote a quick script to see. It was the first time I'd used the twitter API and was happy to see how simple it was. Probably took me maybe all of 15 minutes; I think it actually took me longer to put together this posting.
Turns out that unsurprisingly most of the participants were from the RDU area, followed by a New England/NYC contingent, then a few west coasters: SF (me), Portland and WA. I could have sworn I saw someone from the Czech Republic, but they disappeared in a subsequent run. Must have been a glitch. Here's the breakdown (or as Google spreadsheet):
1000yregg Baltimore, MD
AdelaideHayward Port Ludlow, WA
alycemarie somerville, ma
barnacle_goose iPhone: 34.170956,-80.303963
biffbangpowell Durham, NC
bobbymcdonald Raleigh, NC
bradleysalmanac Allston, MA
bwall05 Connecticut
bzrd chapel hill nc
catscradlenc Carrboro, NC
currincy iPhone: 35.789791,-78.626205
dan_mccleary Chapel Hill, NC
dav San Francisco, CA
dbrine1 NJ
ejrc Brooklyn
eshep apex, nc
indyweek Raleigh - Durham - Chapel Hill
johndemartino Durham NC
jonnypolite iPhone: 45.533173,-122.714920 (Portland, OR)
jseaton Raleigh
kbodnar32 Raleigh, NC
malitzd Arlington, VA
mergerecords North Carolina
mike_noodle Raleigh... RA-LEIGH
nervousacid Brooklyn, NY
rossgrady iPhone: 35.994507,-78.902725
spinmagazine New York, NY
stoftey Oak City
straintest New York, NY
the_dp Carrburritos Taqueria
timnyc Williamsburg, New York
trianglemusic Raleigh/Durham/Chapel Hill, NC
val1124 Cary, NC
WNRNradio Charlottesville, VA
wordnerdy Durham, NC
Here's the source code (need ruby and curb to run):
require 'rubygems'Btw, last nights six slots is putting a serious damper on my 'extra slots' theory. I'm still holding out for surprise band though. Here's the updated schedule sheet. I'm sticking with the previous Friday night picks. Telekinesis and M.Ward for Saturday night. And Arcade Fire.
require 'curb'
require 'json'
STDOUT.sync = true
exit unless ARGV[0]
search_term = ARGV[0]
def grab_page_of_search_results(search_term, page_number)
json = Curl::Easy.perform("http://search.twitter.com/search.json?rpp=100&q=#{search_term}").body_str
search_response = JSON.parse(json)
puts "Found #{search_response['results'].size} tweets on page #{page_number}."
return search_response['results']
end
def grab_user_data(user)
json = Curl::Easy.perform("http://twitter.com/users/show/#{user}.json").body_str
return JSON.parse(json)
end
tweeters = {}
1..15.times do |page|
results = grab_page_of_search_results(search_term, page)
break if results.size == 0
results.each do |result|
print '.'
user = result['from_user']
if tweeters[user].nil?
user_data = grab_user_data(user)
tweeters[user] = user_data['location']
end
end
print "\n"
end
puts "#{tweeters.size} unique tweeters:"
tweeters.each do |user,location|
puts "\"#{user}\",\"#{location}\"" unless location == ''
end
Comments