Coder Social home page Coder Social logo

correia-jpv / github-follow-bot Goto Github PK

View Code? Open in Web Editor NEW
76.0 3.0 14.0 72 KB

๐Ÿค– Automated follow/unfollow bot for GitHub. Follow from multiple sources. Choose which users to unfollow. Custom options to control bot speed and maximum actions.

License: MIT License

Python 100.00%
python github github-api bot bots automation automatic follow followers following

github-follow-bot's Introduction

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

Getting Started

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.

GITHUB_USER=YOUR_GITHUB_USERNAME
TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

How to Use

Follow

Target user's followers

python bot_follow.py -t <TARGET_USER>

Followers of the most popular users from a country

(list of valid countries)

python bot_follow.py -p <COUNTRY_NAME>

From a file

Follow users from a pre-generated file (JSON)

python bot_follow.py -f <FILENAME>

Unfollow

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

All

Unfollow all your followings

python bot_unfollow.py -a

Followers

Only unfollow users who already follow you

python bot_unfollow.py -fo

Non-followers

Only unfollow users who don't follow you back

python bot_unfollow.py -nf

From a file

Unfollow users from a pre-generated file (JSON)

python bot_unfollow.py -f <FILENAME>

Options

Maximum follows/unfollows

Set the 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
     -slmin 600
    
  • Maximum delay when rate limited
     -slmin 1500
    

Future Implementation

  • Schedule - Bot only performs actions between set time and sleeps after off-schedule
  • Max follow per source - Follow max n per popular user
  • Add follow source - Follow users per topic
  • 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! Read the contribution guidelines first.

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

github-follow-bot's People

Contributors

correia-jpv avatar dependabot[bot] avatar simonecorsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

github-follow-bot's Issues

[BUG] Doesn't work or follow any user even though terminal said it does!

Describe the bug
I was testing the code for days, but I was curious why the sleep took so long so I change it into 20-30s now that I have all the list of the -t followers to follow, the code follows them all successfully, but it didn't do anything at all it gave me false flag in the terminal I was expecting following 647 users but I'm still in 149
.
To Reproduce
Steps to reproduce the behavior:

  1. Go to github-follow-bot
  2. python3 bot_follow.py -t
  3. Scroll down to terminal saying it: master - python3 bot_follow.py -t

Successful authentication.

Grabbing MiChaelinzo's followings.

Grabbing followers.

Starting to follow.

Finished following!

I cannot give out my here since it would violate privacy law.

  1. See error

Expected behavior
To follow all the users from the -t

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2023-10-05 071047

Desktop (please complete the following information):

  • OS: Linux version 6.1.21-v8+ (dom@buildbot) (aarch64-linux-gnu-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023

  • Browser Chronium Version 113.0.5672.95 (Official Build) Built on Debian , running on Debian 11 (64-bit)

  • Version latest version (git pull)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
I thought I was following users but it was not doing anything at all!

[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

[REQUEST]

if the user name have anumbers it doesn't work becuase of data type

Traceback (most recent call last):
File "/home/-----/github-follow-bot/bot_follow.py", line 38, in
bot = GithubAPIBot(
^^^^^^^^^^^^^
File "/home/-----/github-follow-bot/GithubAPIBot.py", line 68, in init
self.getFollowings()
File "/home/----/github-follow-bot/GithubAPIBot.py", line 226, in getFollowings
self.followings.extend(self.getUsers(url=f"https://api.github.com/users/{username}/following"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/----/github-follow-bot/GithubAPIBot.py", line 192, in getUsers
and not (user["login"] in self.followings)
~~~~^^^^^^^^^
TypeError: string indices must be integers, not 'str'

TypeError: Missing/Incorrect username

Description:
When attempting to run the bot_follow.py script using Python, the following error is encountered:
e

Expected Behavior:
The script should initialize the GithubAPIBot object without errors, provided that the necessary parameters, including the username, are provided correctly.

Actual Behavior:
The script raises a TypeError with the message "Missing/Incorrect username," indicating that there is an issue with the provided username or that it is missing.

Steps to Reproduce:

Ensure Python is installed.
Navigate to the directory containing the bot_follow.py script.
Run the script using Python: python.exe .\bot_follow.py

Additional Information:

This issue seems to originate from the GithubAPIBot class constructor (__init__) in the GithubAPIBot.py file.
The error suggests that the username parameter is either missing or incorrect.
Verify that the username parameter is provided correctly when initializing the GithubAPIBot object.
Check for any typos or issues with the username variable or its assignment.
Ensure that the script is being run in an environment where the necessary dependencies and configurations are set up correctly.

Potential Fix:

Double-check the username parameter when initializing the GithubAPIBot object in the bot_follow.py script.
Ensure that the username is provided as expected, and there are no typos or formatting issues.
If the username is provided dynamically, verify that the mechanism for retrieving the username is functioning correctly.
Review the GithubAPIBot.py file to confirm that the username parameter is being handled appropriately in the __init__ method.

[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.

Nothing to unfollow

Hello there, I sam still getting the Nothing to unfollow message when trying to unfollow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.