Skip to content

Instantly share code, notes, and snippets.

@ShaneCurcuru
Forked from rubys/conflist-counts.rb
Created April 22, 2017 19:39
Show Gist options
  • Save ShaneCurcuru/152dbff286ebbc473d79611b6753f453 to your computer and use it in GitHub Desktop.
Save ShaneCurcuru/152dbff286ebbc473d79611b6753f453 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