Created
May 29, 2012 14:03
-
-
Save IanVaughan/2828604 to your computer and use it in GitHub Desktop.
Quick hack to get a list of all our repos
This file contains 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
# curl -u "user:password" https://api.github.com/orgs/:org/repos | |
require 'httparty' | |
require 'pp' | |
class GitHub | |
include HTTParty | |
base_uri 'https://api.github.com' | |
def initialize(u, p) | |
@auth = {:username => u, :password => p} | |
end | |
def repos repo | |
self.class.get("/orgs/#{repo}/repos", {:basic_auth => @auth}) | |
end | |
end | |
repos = GitHub.new('user','pass').repos('org') | |
repos.each do |r| | |
puts r['name'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment