Skip to content

Gatekeeper is a Python script for managing followers and following users on GitHub.

License

Notifications You must be signed in to change notification settings

kelseykm/gatekeeper

Repository files navigation

Gatekeeper

Gatekeeper is a Python script for managing followers and following users on GitHub. The script allows you to list, follow, or unfollow users based on whether they follow you back or not. You can also define exceptions in the configuration file to exclude certain users from being included in these lists.

Features

  • List all your followers
  • List all users you're following
  • List users you're following but aren't following you back
  • Unfollow users who aren't following you back
  • List users following you but you're not following them back
  • Follow users who are following you but you're not following back
  • Supports user-defined exceptions for certain categories (crooks and niceys)

Installation

  1. Clone the repository to your local machine:

    git clone https://github.com/yourusername/gatekeeper.git
  2. Navigate into the project directory:

    cd gatekeeper
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Ensure you have created a config.toml file based on the provided example.config.toml.

Configuration

You’ll need to configure the API_KEY in the config.toml file for the script to work with GitHub's API. You can use the provided example.config.toml file as a template for creating your own config.toml.

Example Configuration File

  1. Copy the example.config.toml file and rename it to config.toml (it’s just a template).
  2. Fill in your GitHub Personal Access Token for API_KEY and adjust the crooks and niceys lists as needed.

Here's the structure you should follow:

[security]
API_KEY = ""  # Replace with your GitHub API Key

[users.exceptions]
crooks = [] 
niceys = [] 
  • The API_KEY field should be filled with your GitHub Personal Access Token. You can create one on GitHub here.
  • The crooks and niceys fields are optional and can be used to maintain a list of users that fit these categories, which you can use in your program’s logic.

How Exceptions Are Used

The crooks and niceys lists in the config.toml file are used to manage exceptions when filtering your followers and followings:

  • Crooks: This list is used to exclude users you're following who aren't following you back. For example, the function get_crooks_logins calculates users you follow but removes those listed in the crooks exception list.

  • Niceys: This list is used to exclude users who are following you but you aren't following them back. The function get_niceys_logins identifies such users and removes those listed in the niceys exception list.

Example

[security]
API_KEY = "your_github_api_key_here"

[users.exceptions]
crooks = ["user1", "user2"]
niceys = ["user3", "user4"]

In the above example:

  • "user1" and "user2" are considered exceptions and won't be included in the list of "crooks."
  • "user3" and "user4" are exceptions and won't be included in the list of "niceys."

Usage

After configuring the config.toml file, you can run the script directly from the command line with different options.

Command-Line Arguments

usage: gatekeeper [-h] [-v] (--list_followers | --list_following | --list_crooks | --unfollow_crooks | --list_niceys | --follow_niceys)

Manage followers and following users on Github

options:
  -h, --help         show this help message and exit
  -v, --version      show program's version number and exit
  --list_followers   List all your followers
  --list_following   List all users you're following
  --list_crooks      List all users you're following but aren't following you back
  --unfollow_crooks  Unfollow all users who aren't following you back
  --list_niceys      List all users that are following you but you aren't following them back
  --follow_niceys    Follow all users that you are following you but you aren't following them

Example Usage

  1. List all followers:

    python run.py --list_followers
  2. List all users you're following:

    python run.py --list_following
  3. List all users you're following but aren't following you back:

    python run.py --list_crooks
  4. Unfollow all users who aren't following you back:

    python run.py --unfollow_crooks
  5. List all users following you but you aren't following them back:

    python run.py --list_niceys
  6. Follow all users that are following you but you aren't following them back:

    python run.py --follow_niceys

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Gatekeeper is a Python script for managing followers and following users on GitHub.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages