Skip to content

Instantly share code, notes, and snippets.

@andrew
Created November 20, 2013 23:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrew/7573017 to your computer and use it in GitHub Desktop.
Save andrew/7573017 to your computer and use it in GitHub Desktop.
Follow everyone in all orgs that you're a member of
require 'octokit'
# usage: $ ACCESS_TOKEN=1234567890abcdef ruby followbomb.rb
# create a token here: https://github.com/settings/tokens/new
client = Octokit::Client.new :access_token => ENV['ACCESS_TOKEN']
puts "Loading members of all orgs"
members = client.orgs.map{|org| client.organization_members(org.login) }.flatten.map(&:login)
puts "Found #{members.length} members (#{members.uniq.length} unique)"
members = members.uniq.sort
members.each do |m|
puts "Following #{m}"
client.follow(m)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment