Created
August 8, 2019 21:52
-
-
Save artkirienko/a931e78c85323a3fcaaffcd0a209b9d9 to your computer and use it in GitHub Desktop.
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
# 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