Skip to content

Instantly share code, notes, and snippets.

@lengarvey
Created January 12, 2012 04:42
Show Gist options
  • Save lengarvey/1598831 to your computer and use it in GitHub Desktop.
Save lengarvey/1598831 to your computer and use it in GitHub Desktop.
Get a list of how many gems there are for each letter.
require 'rest_client'
url = "http://rubygems.org/gems?letter="
('A' .. 'Z').each do |letter|
response = RestClient.get url + letter
total = response.to_s.match(/(\d+)<\/b> in total/)[1]
puts letter + " total " + total
end
A total 2130
B total 1357
C total 2392
D total 1472
E total 1057
F total 1336
G total 1566
H total 1066
I total 820
J total 741
K total 449
L total 852
M total 2217
N total 763
O total 762
P total 1654
Q total 172
R total 4164
S total 3547
T total 1739
U total 414
V total 537
W total 802
X total 198
Y total 296
Z total 198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment