Skip to content

Instantly share code, notes, and snippets.

View tanookiben's full-sized avatar
☁️
just setting up my gthb

Benjamin Hsieh tanookiben

☁️
just setting up my gthb
View GitHub Profile
@tanookiben
tanookiben / read_activity.rb
Last active December 16, 2015 00:38 — forked from igrigorik/read_activity.rb
Read data from githubarchive.org file and process records.
require 'open-uri'
require 'zlib'
require 'yajl'
gz = open('http://data.githubarchive.org/2012-03-11-12.json.gz')
js = Zlib::GzipReader.new(gz).read
events = [] # list of each event for the specified date based on predefined event types
Yajl::Parser.parse(js) do |event|
# puts event <-- not particularly useful in demoing how to actually see the data