Created
January 12, 2012 04:42
-
-
Save lengarvey/1598831 to your computer and use it in GitHub Desktop.
Get a list of how many gems there are for each letter.
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 '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 |
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
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