Created
April 22, 2017 19:38
-
-
Save rubys/5dc7e8cd8caa19eb2a2491c69a05df94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'net/http' | |
conflist = JSON.parse(Net::HTTP.get(URI('https://raw.githubusercontent.com/afilina/dev-community-data/master/data/conferences.json'))) | |
counts = %w(ticket_included hotel_included travel_included).map do |field| | |
matches = conflist.select do |conf| | |
conf['speaker_kit'] && conf['speaker_kit'][field] | |
end | |
[field, matches.count] | |
end | |
counts = counts.to_h | |
counts['all'] = conflist.count | |
puts JSON.pretty_generate(counts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment