├── chromedriver.exe ├── README.md ├── LICENSE └── follow_bot.py /chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ashwin-op/GitHub-Follow-Bot/HEAD/chromedriver.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GitHub-Follow-Bot 2 | 3 | A bot done with python to follow users in GitHub. 4 | 5 | 6 | ## How to use: 7 | 8 | - Fill your GitHub `username` and `password` in the space provided 9 | - Fill the person's GitHub `username` whose followers following you want to follow(That might be a little confusing). Basically, select a person(for example, take yourself), you will have some followers, for each of your follower, this bot will follow whoever they are following. 10 | - Then run the python file (It need selenium to run, so `pip install selenium`). 11 | 12 | 13 | ## Why I did this? 14 | 15 | Somewhere, I read: 16 | - One in ten people you follow will follow you back. 17 | - One in hundred people you follow will star your repos. 18 | - One in thousand people you follow will fork your repos. 19 | 20 | Might be true, might be not 🤷‍. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Ashwin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /follow_bot.py: -------------------------------------------------------------------------------- 1 | import time 2 | import sys 3 | from selenium import webdriver 4 | from selenium.webdriver.common.by import By 5 | from selenium.webdriver.support.ui import WebDriverWait 6 | from selenium.webdriver.support import expected_conditions as EC 7 | 8 | # Initializing the headless chrome 9 | driver = webdriver.Chrome() 10 | driver.get("https://github.com/login") 11 | wait = WebDriverWait(driver, 10) 12 | 13 | # Locating username and password field 14 | username = wait.until(EC.presence_of_element_located((By.ID, "login_field"))) 15 | password = wait.until(EC.presence_of_element_located((By.ID, "password"))) 16 | 17 | # password and username need to go into these values 18 | username.send_keys("username") 19 | password.send_keys("password") 20 | 21 | # Clicking the sign in button 22 | login_form = wait.until(EC.presence_of_element_located((By.XPATH, "//input[@value='Sign in']"))) 23 | login_form.click() 24 | 25 | # Go to the followers tab 26 | nameOfUser = "" # Input github username here 27 | 28 | driver.get("https://github.com/{}?tab=followers".format(nameOfUser)) 29 | time.sleep(3) 30 | 31 | # Find the followers 32 | users = driver.find_elements_by_xpath("//a[@data-hovercard-type='user']") 33 | temp = [] 34 | for follower in users: 35 | temp.append(follower.get_attribute("href")) 36 | list_set = set(temp) 37 | followers = (list(list_set)) 38 | 39 | # Follow everyone who is following 'nameOfUser' 40 | for user in followers: 41 | for page in range(1, 5): 42 | string = "{}?page={}&tab=following".format(user, page) 43 | driver.get(string) 44 | time.sleep(3) 45 | 46 | follow_button = driver.find_elements_by_xpath("//input[@aria-label='Follow this person']") 47 | 48 | try: 49 | for i in follow_button: 50 | i.submit() 51 | except: 52 | pass 53 | 54 | driver.close() 55 | --------------------------------------------------------------------------------