🤖 Automated follow/unfollow bot for GitHub. Uses GitHub API. Written in python.

Overview

GitHub Follow Bot

Table of Contents

Disclaimer

This is a PoC and was developed for educational purposes only. You may get your account banned. Use at your own risk.

Spam and Inauthentic Activity on GitHub

Automated excessive bulk activity and coordinated inauthentic activity, such as spamming, are prohibited on GitHub. Prohibited activities include:

  • (...)
  • inauthentic interactions, such as fake accounts and automated inauthentic activity
  • rank abuse, such as automated starring or following

From GitHub Acceptable Use Policies

How to Use

Install requirements

pip install -r requirements.txt

Authenticate

Get a GitHub Personal Access Token

Make sure to enable the user scope and all subscopes inside of that permission.

How to get your GitHub PAT

Add your GitHub username and PAT to .env file

Create a .env file on the project's root directory or edit .env.sample (rename to .env) and add your username and PAT.

USER=YOUR_GITHUB_USERNAME
TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

Follow

  • Target user's followers
     python bot_follow.py -t 
         
    
         
  • Most popular users' followers from a country (list of valid countries)
     python bot_follow.py -p 
         
    
         
  • File (usernames separated by comma)
     python bot_follow.py -f 
         
    
         

Unfollow

note: Unfollow order is FIFO, as in the most recently followed user will be the last to be unfollowed.

  • All
     python bot_unfollow.py -a
    
  • Follow back
     python bot_unfollow.py -fb
    
  • File (usernames separated by comma)
     python bot_unfollow.py -f 
         
    
         

Options

Maximum number of follow/unfollow actions

-m 300

Speed

A random delay (in seconds) is performed after follow/unfollow actions or when the account is rate limited. You can change these delays to your liking with the following arguments:

  • Minimum delay between actions
     -smin 20
    
  • Maximum delay between actions
     -smax 120
    
  • Minimum delay when rate limited
     -smin 600
    
  • Maximum delay when rate limited
     -smin 1500
    

Future implementation

  • Schedule - Bot only performs actions between set time and sleeps after off-schedule
  • Add follow source - Grab followers from users listed in a file
  • Email followed users - Send an email to followed users with templates (colaboration, follow back or custom)
  • Star n repositories of followed users

Contributing

Contributions are welcome! Follow the contribution guidelines.

Wish there was another feature? Feel free to open an feature request issue with your suggestion!

If you find a bug, kindly open an bug report issue as described in the contribution guidelines.

Resources

Comments
  • [HELP]

    [HELP]

    How do I make the unfollow bot work -w- I am lost now,

    I tried several ways including using -t and my GitHub name and revoking token and regenerating the token and update .env

    Can you just type an example of how to use the unfollow bot using the -nf

    image cd follow-bot && python bot_unfollow.py -fo

    image cd follow-bot && python bot_unfollow.py -nf -smin 50

    help wanted 
    opened by alejandroatacho 3
  • Update README.md

    Update README.md

    Corrected the variable name in the description to match the one used in the project (it didn't work for me at first because I was using USER instead of GITHUB_USER)

    opened by f4b1n 1
  • fix: nothing to follow

    fix: nothing to follow

    I fixed the Nothing to follow bug/issue.

    I changed this line parser.add_argument('-mu', '--max-unfollow', help="Max Number of People to Unfollow") to parser.add_argument('-mu', '--max', help="Max Number of People to Unfollow")

    and mnof = args.max_followers to mnof = args.max

    The argument max_followers had not been defined in the parser. Also, I changed max-unfollow to max since the special character -` was breaking that line.

    opened by david-kariuki 0
  • [BUG] Incorrect environment variable Linux

    [BUG] Incorrect environment variable Linux

    'USER' environment variable being used by the bot to store the GitHub username is being overridden by the operating system username on Linux distributions that commonly use this environment variable.

    A solution is to rename this environment variable to 'GITHUB_USER', for example.

    bug 
    opened by Correia-jpv 0
  • Bump urllib3 from 1.24.3 to 1.26.5

    Bump urllib3 from 1.24.3 to 1.26.5

    Bumps urllib3 from 1.24.3 to 1.26.5.

    Release notes

    Sourced from urllib3's releases.

    1.26.5

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.4

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.3

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme (Pull #2107)

    If you or your organization rely on urllib3 consider supporting us via GitHub Sponsors

    1.26.2

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

    1.26.1

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

    1.26.0

    :warning: IMPORTANT: urllib3 v2.0 will drop support for Python 2: Read more in the v2.0 Roadmap

    • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

    • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning should opt-in explicitly by setting ssl_version=ssl.PROTOCOL_TLSv1_1 (Pull #2002) Starting in urllib3 v2.0: Connections that receive a DeprecationWarning will fail

    • Deprecated Retry options Retry.DEFAULT_METHOD_WHITELIST, Retry.DEFAULT_REDIRECT_HEADERS_BLACKLIST and Retry(method_whitelist=...) in favor of Retry.DEFAULT_ALLOWED_METHODS, Retry.DEFAULT_REMOVE_HEADERS_ON_REDIRECT, and Retry(allowed_methods=...) (Pull #2000) Starting in urllib3 v2.0: Deprecated options will be removed

    ... (truncated)

    Changelog

    Sourced from urllib3's changelog.

    1.26.5 (2021-05-26)

    • Fixed deprecation warnings emitted in Python 3.10.
    • Updated vendored six library to 1.16.0.
    • Improved performance of URL parser when splitting the authority component.

    1.26.4 (2021-03-15)

    • Changed behavior of the default SSLContext when connecting to HTTPS proxy during HTTPS requests. The default SSLContext now sets check_hostname=True.

    1.26.3 (2021-01-26)

    • Fixed bytes and string comparison issue with headers (Pull #2141)

    • Changed ProxySchemeUnknown error message to be more actionable if the user supplies a proxy URL without a scheme. (Pull #2107)

    1.26.2 (2020-11-12)

    • Fixed an issue where wrap_socket and CERT_REQUIRED wouldn't be imported properly on Python 2.7.8 and earlier (Pull #2052)

    1.26.1 (2020-11-11)

    • Fixed an issue where two User-Agent headers would be sent if a User-Agent header key is passed as bytes (Pull #2047)

    1.26.0 (2020-11-10)

    • NOTE: urllib3 v2.0 will drop support for Python 2. Read more in the v2.0 Roadmap <https://urllib3.readthedocs.io/en/latest/v2-roadmap.html>_.

    • Added support for HTTPS proxies contacting HTTPS servers (Pull #1923, Pull #1806)

    • Deprecated negotiating TLSv1 and TLSv1.1 by default. Users that still wish to use TLS earlier than 1.2 without a deprecation warning

    ... (truncated)

    Commits
    • d161647 Release 1.26.5
    • 2d4a3fe Improve performance of sub-authority splitting in URL
    • 2698537 Update vendored six to 1.16.0
    • 07bed79 Fix deprecation warnings for Python 3.10 ssl module
    • d725a9b Add Python 3.10 to GitHub Actions
    • 339ad34 Use pytest==6.2.4 on Python 3.10+
    • f271c9c Apply latest Black formatting
    • 1884878 [1.26] Properly proxy EOF on the SSLTransport test suite
    • a891304 Release 1.26.4
    • 8d65ea1 Merge pull request from GHSA-5phf-pp7p-vc2r
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • feat: healthy user checks and minimum followers

    feat: healthy user checks and minimum followers

    Hey 👋

    I was testing the bot and I think it could be useful to have a --min-followers and an --healthy-user check.

    This is opinated, especially the healthy user checks, which check that users has some public repos and that its followers/following ratio is not a of a spammy user.

    Let me know WDYT and if this is something useful and/or if we can tune it better

    opened by simonecorsi 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/codeql-analysis.yml (github-actions)
    • requirements.txt (pip_requirements)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 6 Pull Requests:

    chore(deps): update dependency urllib3 to v1.26.12
    • Schedule: ["at any time"]
    • Branch name: renovate/urllib3-1.x
    • Merge into: master
    • Upgrade urllib3 to ==1.26.12
    chore(deps): update dependency python-dotenv to v0.21.0
    • Schedule: ["at any time"]
    • Branch name: renovate/python-dotenv-0.x
    • Merge into: master
    • Upgrade python-dotenv to ==0.21.0
    chore(deps): update dependency requests to v2.28.1
    • Schedule: ["at any time"]
    • Branch name: renovate/requests-2.x
    • Merge into: master
    • Upgrade requests to ==2.28.1
    chore(deps): update dependency tqdm to v4.64.1
    • Schedule: ["at any time"]
    • Branch name: renovate/tqdm-4.x
    • Merge into: master
    • Upgrade tqdm to ==4.64.1
    chore(deps): update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: master
    • Upgrade actions/checkout to v3
    chore(deps): update github/codeql-action action to v2
    • Schedule: ["at any time"]
    • Branch name: renovate/github-codeql-action-2.x
    • Merge into: master
    • Upgrade github/codeql-action to v2

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
João Correia
Full stack dev 🗿 Going down the modern front-end tech rabbit hole and looking to contribute to fun projects.
João Correia
Sunflower-farmers-automated-bot - Sunflower Farmers NFT Game automated bot.IT IS NOT a cheat or hack bot

Sunflower-farmers-auto-bot Sunflower Farmers NFT Game automated bot.IT IS NOT a

Arthur Alves 17 Nov 9, 2022
This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

This is a simple program that uses Python and pyTwitchAPI to retrieve the list of users in a streamer's chat and then checks each one of these users to see if they follow the broadcaster or not

RwinShow 57 Dec 18, 2022
Unofficial instagram API, give you access to ALL instagram features (like, follow, upload photo and video and etc)! Write on python.

Instagram-API-python Unofficial Instagram API to give you access to ALL Instagram features (like, follow, upload photo and video, etc)! Written in Pyt

Vladimir Bezrukov 1 Nov 19, 2021
Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

Automation that uses Github Actions, Google Drive API, YouTube Data API and youtube-dl together to feed BackJam app with new music

Antônio Oliveira 1 Nov 21, 2021
Botto - A discord bot written in python that uses the hikari and lightbulb modules to make this bot

❓ About Botto Hi! This is botto, a discord bot written in python that uses the h

null 3 Sep 13, 2022
Simple Python Auto Follow Bot

Instagram-Auto-Follow-Bot Description Một IG BOT đơn giản. Tự động follow những người mà bạn muốn cướp follow. Tự động unfollow. Tự động đăng nhập vào

CodingLinhTinh 3 Aug 27, 2022
This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners and alerts system.

Python Trading Bot w/ Thinkorswim Description This program is an automated trading bot that uses TDAmeritrades Thinkorswim trading platform's scanners

Trey Thomas 201 Jan 3, 2023
This bot will automatically like and follow users that post under a specified hashtag

Instagram-bot This bot will automatically like and follow users that post under a specified hashtag Dependencies Java JDK Selenium Updated version of

Makana Edwards 1 Nov 4, 2021
Rhythm bot clone for discord written in Python and uses YouTube to get media files.

Tunebot About Rhythm bot clone for discord written in Python and uses YouTube to get media files. Usage You need a .env file within the same directory

null 1 Oct 21, 2021
A Anything goes Discord bot written in python and uses the wrapper Discord.py

GerardTheWizard A Anything goes Discord bot written in python and uses the wrapper Discord.py What can he do? Allow users to level up through typing,

null 1 May 5, 2022
An example Music Bot written in Disnake and uses slash commands to operate.

Music Bot An example music bot that is written in Disnake [Maintained discord.py Fork] Disnake Disnake is a maintained and updated fork of discord.py.

null 6 Jan 8, 2022
Yok bentar lagi update Premium :( DI FOLLOW YA GUYS

SIMBF + PREMIUM PRINTAH PENGINSTALAN ON TERMUX $ pkg update && upgrade $ termux-setup-storage $ pkg install python $ pkg install git $ pip install bs4

Jeeck 21 Jan 14, 2022
Cancel all your follow requests on Instagram.

Unrequester This python code unrequests all your follow requests on Instagram, using selenium. Everything's step-by-step and understanding it is like

ChamRun 3 Apr 9, 2022
Follow pixiv account from twitter profile

Follow pixiv account from twitter profile

Genshi 7 Apr 11, 2022
Ethereum transactions and wallet information for people you follow on Twitter.

ethFollowing Ethereum transactions and wallet information for people you follow on Twitter. Set up Setup python environment (requires python 3.8): vir

Brian Donohue 2 Dec 28, 2021
CLI tool that checks who does and who does not follow you back on Instagram

CLI tool that checks who does and who does not follow you back on Instagram. It also checks who you don't follow back on Instagram.

Ayushman Roy 3 Dec 2, 2022
A Python bot that uses the Reddit API to send users inspiring messages.

AnonBot By Edric Antoine A Python bot that uses the Reddit API to send users inspiring messages. When a message includes 'What would Anon do?', the bo

null 1 Jan 5, 2022
Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot

- [ MAYBE UPDATE & ADD MORE MODULE ] Bagas Mirror&Leech Bot Bagas Mirror&Leech Bot is a multipurpose Telegram Bot written in Python for mirroring file

null 4 Nov 23, 2021
API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

null 2 Dec 22, 2021