Skip to content

Instantly share code, notes, and snippets.

@StephenOTT
Last active August 29, 2015 13:57
Show Gist options
  • Save StephenOTT/9512777 to your computer and use it in GitHub Desktop.
Save StephenOTT/9512777 to your computer and use it in GitHub Desktop.
Determine what the Max number of Repo parameters that GitHub Search API supports
require 'octokit'
require 'pp'
class GHSearchTest
def gh_authenticate(username, password)
@ghClient = Octokit::Client.new(
:login => username.to_s,
:password => password.to_s,
:auto_paginate => true
)
end
def searchTest(query)
# array1 = []
searchResults = @ghClient.search_repositories(query)
searchResults.attrs[:items].each do |x|
fullName = x.attrs[:full_name]
pp fullName
# pp x.attrs[:updated_at]
# array1 << fullName
end
# output = ""
# array1.each do |a|
# output << "repo:#{a} "
# end
# puts output
end
end
start = GHSearchTest.new
start.gh_authenticate("USERNAME", "PASSWORD")
# start.searchTest("repo:StephenOTT/GitHub-Time-Tracking")
# start.searchTest("ruby")
# 100 Repos
start.searchTest("repo:ruby/ruby repo:neo/ruby_koans repo:bbatsov/ruby-style-guide repo:rails/rails repo:sstephenson/ruby-build repo:ryanb/ruby-warrior repo:rubygems/rubygems repo:MacRuby/MacRuby repo:vim-ruby/vim-ruby repo:huacnlee/ruby-china repo:rubygems/rubygems.org repo:schacon/ruby-git repo:rubyspec/rubyspec repo:aws/aws-sdk-ruby repo:brianmario/yajl-ruby repo:oneclick/rubyinstaller repo:mongodb/mongo-ruby-driver repo:less/less.ruby repo:heroku/heroku-buildpack-ruby repo:jashkenas/ruby-processing repo:cantino/ruby-readability repo:twilio/twilio-ruby repo:dcparker/ruby-gmail repo:gregstallings/ruby-trivia repo:HipByte/RubyMotion repo:Instagram/instagram-ruby-gem repo:reedlaw/ruby-mmo repo:HipByte/RubyMotionSamples repo:rubyzip/rubyzip repo:drnic/ruby-on-rails-tmbundle repo:onelogin/ruby-saml repo:ruby/www.ruby-lang.org repo:lian/bitcoin-ruby repo:ruby-prof/ruby-prof repo:stripe/stripe-ruby repo:nhmood/watson-ruby repo:jfelchner/ruby-progressbar repo:codahale/bcrypt-ruby repo:jeremytregunna/ruby-trello repo:rackerlabs/ruby-cloudfiles repo:openid/ruby-openid repo:elm-city-craftworks/practicing-ruby-manuscripts repo:mark-moseley/ruby-debug repo:Sophrinix/TryRuby repo:weshatheleopard/rubyXL repo:postmodern/ruby-install repo:seancribbs/webmachine-ruby repo:sumoheavy/jira-ruby repo:mruby/mruby repo:jekyll/jekyll repo:youpy/ruby-lastfm repo:ryanfb/ruby-opencv repo:seattlerb/ruby_parser repo:alexch/learn_ruby repo:gimite/google-drive-ruby repo:fog/fog repo:ryanb/cancan repo:elasticsearch/elasticsearch-ruby repo:gregbell/active_admin repo:google/google-api-ruby-client repo:opscode/omnibus-ruby repo:maltize/sublime-text-2-ruby-tests repo:glejeune/Ruby-Graphviz repo:getsentry/raven-ruby repo:rubycas/rubycas-server repo:drnic/ruby-tmbundle repo:JoshCheek/ruby-kickstart repo:sferik/twitter repo:binarylogic/authlogic repo:olbrich/ruby-units repo:johnewart/ruby-metrics repo:poise/application_ruby repo:javan/whenever repo:airbnb/ruby repo:saberma/ruby-dev-bookmarks repo:rubygame/rubygame repo:rack/rack repo:alexreisner/geocoder repo:robbyrussell/rubyurl repo:braintree/braintree_ruby repo:petrovich/petrovich-ruby repo:mongoid/mongoid repo:c42/ruby_primer repo:rubinius/rubinius repo:headius/rubyflux repo:judofyr/ruby-oembed repo:saucelabs/sauce_ruby repo:gimite/web-socket-ruby repo:mperham/sidekiq repo:msgpack/msgpack-ruby repo:jruby/jruby repo:soundcloud/soundcloud-ruby repo:zdavison/NSString-Ruby repo:ruby-ldap/ruby-net-ldap repo:rubycas/rubycas-client repo:mikel/mail repo:basho/riak-ruby-client repo:rubyrep/rubyrep repo:YorickPeterse/ruby-lint repo:ai/r18n")
# 101 Repos - Returns a Bad Gateway response: 502 - Server Error (Octokit::BadGateway)
# start.searchTest("repo:ruby/ruby repo:neo/ruby_koans repo:bbatsov/ruby-style-guide repo:rails/rails repo:sstephenson/ruby-build repo:ryanb/ruby-warrior repo:rubygems/rubygems repo:MacRuby/MacRuby repo:vim-ruby/vim-ruby repo:huacnlee/ruby-china repo:rubygems/rubygems.org repo:schacon/ruby-git repo:rubyspec/rubyspec repo:aws/aws-sdk-ruby repo:brianmario/yajl-ruby repo:oneclick/rubyinstaller repo:mongodb/mongo-ruby-driver repo:less/less.ruby repo:heroku/heroku-buildpack-ruby repo:jashkenas/ruby-processing repo:cantino/ruby-readability repo:twilio/twilio-ruby repo:dcparker/ruby-gmail repo:gregstallings/ruby-trivia repo:HipByte/RubyMotion repo:Instagram/instagram-ruby-gem repo:reedlaw/ruby-mmo repo:HipByte/RubyMotionSamples repo:rubyzip/rubyzip repo:drnic/ruby-on-rails-tmbundle repo:onelogin/ruby-saml repo:ruby/www.ruby-lang.org repo:lian/bitcoin-ruby repo:ruby-prof/ruby-prof repo:stripe/stripe-ruby repo:nhmood/watson-ruby repo:jfelchner/ruby-progressbar repo:codahale/bcrypt-ruby repo:jeremytregunna/ruby-trello repo:rackerlabs/ruby-cloudfiles repo:openid/ruby-openid repo:elm-city-craftworks/practicing-ruby-manuscripts repo:mark-moseley/ruby-debug repo:Sophrinix/TryRuby repo:weshatheleopard/rubyXL repo:postmodern/ruby-install repo:seancribbs/webmachine-ruby repo:sumoheavy/jira-ruby repo:mruby/mruby repo:jekyll/jekyll repo:youpy/ruby-lastfm repo:ryanfb/ruby-opencv repo:seattlerb/ruby_parser repo:alexch/learn_ruby repo:gimite/google-drive-ruby repo:fog/fog repo:ryanb/cancan repo:elasticsearch/elasticsearch-ruby repo:gregbell/active_admin repo:google/google-api-ruby-client repo:opscode/omnibus-ruby repo:maltize/sublime-text-2-ruby-tests repo:glejeune/Ruby-Graphviz repo:getsentry/raven-ruby repo:rubycas/rubycas-server repo:drnic/ruby-tmbundle repo:JoshCheek/ruby-kickstart repo:sferik/twitter repo:binarylogic/authlogic repo:olbrich/ruby-units repo:johnewart/ruby-metrics repo:poise/application_ruby repo:javan/whenever repo:airbnb/ruby repo:saberma/ruby-dev-bookmarks repo:rubygame/rubygame repo:rack/rack repo:alexreisner/geocoder repo:robbyrussell/rubyurl repo:braintree/braintree_ruby repo:petrovich/petrovich-ruby repo:mongoid/mongoid repo:c42/ruby_primer repo:rubinius/rubinius repo:headius/rubyflux repo:judofyr/ruby-oembed repo:saucelabs/sauce_ruby repo:gimite/web-socket-ruby repo:mperham/sidekiq repo:msgpack/msgpack-ruby repo:jruby/jruby repo:soundcloud/soundcloud-ruby repo:zdavison/NSString-Ruby repo:ruby-ldap/ruby-net-ldap repo:rubycas/rubycas-client repo:mikel/mail repo:basho/riak-ruby-client repo:rubyrep/rubyrep repo:YorickPeterse/ruby-lint repo:ai/r18n repo:cequel/cequel")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment