Last active
April 27, 2016 21:03
-
-
Save tophyr/6c82eb68c7c59e6e8ab6e9ff27e191dc to your computer and use it in GitHub Desktop.
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
#!/usr/bin/ruby | |
require "json" | |
user = <INSERT USERNAME> | |
pass = <INSERT PASSWORD> | |
page = 1 | |
begin | |
resp = `curl -u #{user}:#{pass} -s "https://api.github.com/users/cyanogenmod/repos?per_page=100&page=#{page}"` | |
repos = JSON.load(resp) | |
page += 1 | |
repos.each { |repo| | |
begin | |
resp = `curl -u #{user}:#{pass} -s "https://api.github.com/repos/cyanogenmod/#{repo["name"]}/forks" --data-binary '{"organization":"apocryphone"}'` | |
puts JSON.load(resp)["full_name"] | |
rescue | |
puts "failed to fork #{repo["name"]}" | |
end | |
} | |
end until repos.length == 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment