Last active
August 22, 2022 14:12
-
-
Save martinwoodward/288812fa142e0b1153f60b9555b3d978 to your computer and use it in GitHub Desktop.
Very quick ruby script to create a bash script that will create a montage of your org.
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
# Set OCTOKIT_ACCESS_TOKEN to authenticate with a PAT | |
# Something like OCTOKIT_ACCESS_TOKEN=<<TOKEN>> bundle exec ruby create-org-montage-script.rb | |
require "octokit" | |
Octokit.auto_paginate = true | |
# Replace <<ORG_NAME>> with your GitHub org | |
members = Octokit.org_members "<<ORG_NAME>>" | |
open('org-montage.sh', 'w') { |f| | |
# Yeah, I'm creating a bash script in Ruby - bite me | |
f << "#!/bin/bash\n" | |
members.each do |m| | |
f << "curl " + m[:avatar_url] + " --output images/" + m[:id].to_s + ".jpg\n" | |
end | |
# Uses 'montage' command from ImageMagick (apt install imagemagick) | |
# http://www.imagemagick.org/Usage/montage/ | |
# You probably want to play with the number across here to get a 16:9 image. | |
# I'm creating an image that is 58 images wide made up of 48x48 pixel tiles. | |
f << "montage images/*.jpg -resize 48x48 -mode Concatenate -tile 58x ghmontage.jpg\n" | |
} |
For posterity, this work has been incorporated into https://github.com/andyfeller/gh-montage as an easy to use GitHub CLI extension!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THANK YOU!
Looking to contribute to this amazing idea, here's a version that essentially wraps
gh
CLI to pull the info from GraphQL. I'd love to turn this into a GitHub CLI extension. Any and all feedback appreciated, @martinwoodward