Created
May 12, 2015 18:23
Find 50 most popular Gems that have mime-types as a dependency
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 'net/http' | |
require 'json' | |
def rubygems_get(gem_name: "", endpoint: "") | |
path = File.join("/api/v1/gems/", gem_name, endpoint).chomp("/") + ".json" | |
JSON.parse(Net::HTTP.get("rubygems.org", path)) | |
end | |
results = rubygems_get(gem_name: "mime-types", endpoint: "reverse_dependencies") | |
weighted_results = {} | |
results.each do |name| | |
begin | |
weighted_results[name] = rubygems_get(gem_name: name)["downloads"] | |
rescue => e | |
puts "#{name} #{e.message}" | |
end | |
end | |
weighted_results.sort {|(k1, v1), (k2, v2)| v2 <=> v1 }.first(50).each_with_index do |(k, v), i| | |
puts "#{i}) #{k}: #{v}" | |
end | |
# => | |
# 0) mail: 38847267 | |
# 1) rest-client: 19845309 | |
# 2) capybara: 11600873 | |
# 3) fog: 9654289 | |
# 4) cucumber: 7892972 | |
# 5) paperclip: 7750627 | |
# 6) ohai: 5675728 | |
# 7) chef: 5366914 | |
# 8) docile: 4977921 | |
# 9) carrierwave: 4519289 | |
# 10) cucumber-rails: 3655820 | |
# 11) trollop: 3511748 | |
# 12) fog-core: 3475383 | |
# 13) aws-s3: 3275772 | |
# 14) wasabi: 3093542 | |
# 15) mechanize: 3019966 | |
# 16) typhoeus: 2788435 | |
# 17) parser: 2251897 | |
# 18) ast: 2024847 | |
# 19) ethon: 1818093 | |
# 20) aasm: 1613090 | |
# 21) jekyll: 1359129 | |
# 22) pony: 1283352 | |
# 23) grape: 1196242 | |
# 24) stripe: 1079147 | |
# 25) libyajl2: 993655 | |
# 26) ffi-yajl: 967030 | |
# 27) grit: 832574 | |
# 28) tinder: 750118 | |
# 29) vj-sdk: 697993 | |
# 30) ckeditor: 640111 | |
# 31) active-fedora: 615618 | |
# 32) aws-ses: 603669 | |
# 33) sentry-raven: 549625 | |
# 34) zendesk_api: 401319 | |
# 35) backup: 376706 | |
# 36) couchrest: 358378 | |
# 37) engineyard-serverside: 345452 | |
# 38) gitlab-grit: 339687 | |
# 39) cloudfiles: 329819 | |
# 40) sup: 312066 | |
# 41) comfortable_mexican_sofa: 311467 | |
# 42) mongoid-grid_fs: 286105 | |
# 43) twitter_oauth: 265477 | |
# 44) active_metadata: 251666 | |
# 45) github-linguist: 229490 | |
# 46) vmc: 220320 | |
# 47) RubyApp: 212099 | |
# 48) td-client: 208895 | |
# 49) beaker: 208620 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment