Skip to content

Instantly share code, notes, and snippets.

@artkirienko
Created August 8, 2019 21:52
Show Gist options
  • Save artkirienko/a931e78c85323a3fcaaffcd0a209b9d9 to your computer and use it in GitHub Desktop.
Save artkirienko/a931e78c85323a3fcaaffcd0a209b9d9 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
require 'octokit'
def configure
Octokit.configure do |c|
c.auto_paginate = true
end
end
# @param [String] login
# @return [Array]
def followers(login)
Octokit.followers(login).map(&:login)
end
# @param [String] login
# @return [Array]
def following(login)
Octokit.following(login).map(&:login)
end
# @param [String] login
# @return [Array]
def whos_not_following(login)
following(login) - followers(login)
end
configure
login = 'your_github_username'
puts whos_not_following(login).join(', ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment