Skip to content

Instantly share code, notes, and snippets.

@tsnow
Created March 15, 2014 00:48
Show Gist options
  • Save tsnow/9560111 to your computer and use it in GitHub Desktop.
Save tsnow/9560111 to your computer and use it in GitHub Desktop.
Pi Day with Github Archive http://www.githubarchive.org/
require 'open-uri'
require 'zlib'
require 'yajl'
(1..24).to_a.reverse.each do |i|
gz=open("http://data.githubarchive.org/2014-03-14-#{i}.json.gz") rescue nil;
next if gz.nil?;
js = Zlib::GzipReader.new(gz).read;
Yajl::Parser.parse(js) do |event|
if %w(PullRequestEvent).include? event['type']
number = event['payload']['number'].to_i
if number == 314
puts event['payload']['pull_request']['html_url']
end
end
end
end
# https://github.com/thedjpetersen/subway/pull/314
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment