Skip to content

Instantly share code, notes, and snippets.

@rubys
Created April 22, 2017 19:38
Show Gist options
  • Save rubys/5dc7e8cd8caa19eb2a2491c69a05df94 to your computer and use it in GitHub Desktop.
Save rubys/5dc7e8cd8caa19eb2a2491c69a05df94 to your computer and use it in GitHub Desktop.
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