Skip to content

Commit fd53d3a

Browse files
committed
drop emails from activity events
1 parent 8f9040c commit fd53d3a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crawler/crawler.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434

3535
@latest = []
3636
@latest_key = lambda { |e| "#{e['id']}" }
37+
@clean = lambda do |h|
38+
h.delete('email')
39+
h.each_value do |v|
40+
@clean.call(v) if v.is_a? Hash
41+
v.each {|e| @clean.call(e)} if v.is_a? Array
42+
end
43+
end
3744

3845
process = Proc.new do
3946
req = HttpRequest.new("https://api.github.com/events?per_page=200", {
@@ -66,7 +73,7 @@
6673
@file = File.new(archive, "a+")
6774
end
6875

69-
@file.puts(Yajl::Encoder.encode(event))
76+
@file.puts(Yajl::Encoder.encode(@clean.call(event)))
7077
end
7178

7279
remaining = req.response_header.raw['X-RateLimit-Remaining']

0 commit comments

Comments
 (0)