Last active
February 18, 2020 15:25
-
-
Save freddyb2/c3b75c7ec808bae1277dcccf9b48588f to your computer and use it in GitHub Desktop.
Stootie repo URLS
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' | |
require 'json' | |
########## EDIT HERE ########## | |
GITHUB_ORGANISATION = 'stootie' | |
PAGE_NUMBER = 1 | |
GITHUB_TOKEN = 'TODO' | |
############################### | |
GITHUB_API_REPOS = "https://api.github.com/orgs/#{GITHUB_ORGANISATION}/repos?page=#{PAGE_NUMBER}" | |
response = RestClient.get(GITHUB_API_REPOS, {params: {access_token: GITHUB_TOKEN}}).body | |
repos_urls = JSON.parse(response) | |
.select { |repo| !repo['archived'] } | |
.map { |repo| repo['ssh_url'] } | |
.map { |url| "git clone #{url}" } | |
puts repos_urls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment