This is a Python script using Selenium to automatically downvote posts on communities.win subreddits that have downvoting enabled.
- Python 3.6 or higher
- pip (Python package installer)
- Clone the repository (if you have it):
git clone https://github.com/Riotcoke123/communitieswin_downvotebot.git
- Navigate to the project directory:
cd communitieswin_downvotebot
- Install the required Python libraries:
pip install selenium webdriver-manager
Before running the script, you need to configure your bot account credentials:
- Go to https://communities.win/ and sign up for a new account.
- Use a separate account specifically for bot activity — this is recommended to avoid any issues with your main account.
- After signing up, open the Python script (likely named
main.py
ordownvoter.py
) in a text editor. - Locate the following lines and replace them with your actual credentials:
USERNAME = 'YOUR_USERNAME' PASSWORD = 'YOUR_PASSWORD'
Optional but Recommended: Add your Scored.co API key to the script if you want improved access to site functionality or plan to scale usage.
To run the script on a specific communities.win subreddit (with downvoting enabled), modify the URL
variable in the Python script before execution. For example, to target the /c/funny/new
subreddit:
- Open the Python script in a text editor.
- Locate the
URL
variable:URL = "https://communities.win/c/funny/new"
- Change the URL to the desired communities.win subreddit.
- Execute the script from your terminal:
python your_script_name.py
Replace your_script_name.py
with the actual name of the Python file.
The Python script performs the following actions:
- Imports necessary libraries from Selenium for browser automation, logging for status updates, and time for delays.
- Defines variables for your username, password, the target URL, and CSS selectors for various elements on the page (login button, username/password fields, submit button, and downvote buttons).
- Configures basic logging to display information and potential errors during the script execution.
- Sets up Chrome browser options, including maximizing the window, disabling extensions and GPU, running in a sandbox, and setting a user agent.
- Initializes a Chrome WebDriver using
webdriver-manager
to automatically handle ChromeDriver installation. - Creates a
WebDriverWait
instance to wait for specific elements to become interactable. - Opens the specified URL in the Chrome browser.
- Locates and clicks the login button.
- Finds the username and password input fields, enters your provided credentials, and clicks the submit button.
- Pauses for a few seconds to allow the login process to complete.
- Locates all the downvote buttons on the page using their CSS selector.
- Iterates through the found downvote buttons and attempts to click each one, with a small delay between clicks. Any errors during the click are logged as warnings.
- Includes error handling to catch and log any exceptions that occur during the process.
- Finally, closes the browser window.
Use this script responsibly and ethically. Automating interactions on websites may violate their terms of service. The author is not responsible for any consequences resulting from the use of this script.
This project is licensed under the GNU General Public License v3.0.