Created
October 7, 2019 23:31
-
-
Save tamalw/05b23032b218ebe14782b494aaed342c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'open-uri' | |
require 'json' | |
p = JSON.parse(URI.parse('http://files.olo.com/pizzas.json').read).map { |p| p['toppings'].sort.join(', ') }.flatten | |
puts p.uniq.map { |c| [c, p.count(c)]}.sort { |a,b| b[1] <=> a[1] }[0...20].map.with_index { |t,i| "#{i+1}. #{t[0]}: #{t[1]}" }.join("\n") |
Author
tamalw
commented
Oct 7, 2019
- pepperoni: 4616
- mozzarella cheese: 1014
- four cheese: 956
- bacon: 732
- beef: 623
- sausage: 402
- italian sausage: 361
- chicken: 229
- four cheese, pepperoni: 203
- ham: 165
- mushrooms: 159
- mozzarella cheese, pepperoni: 155
- beef, pepperoni: 122
- bacon, pepperoni: 121
- black olives: 117
- alredo sauce: 101
- pepperoni, sausage: 96
- cheddar cheese: 95
- italian sausage, pepperoni: 85
- pineapple: 79
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment